Simplify appraisal: drop the frontend price cache, the client-side Jita default, and the store #27

Closed
opened 2026-07-09 19:19:22 +02:00 by Sirttas · 0 comments
Owner

Summary

The appraisal store (src/market/appraisal/appraisal.ts) keeps a frontend RegionalMarketCache and defaults the market location to Jita client-side (jitaId in src/market/market.ts). Now that mammon serves per-location prices and owns caching — including defaulting an omitted locationId to Jita server-side — the frontend cache, the client-side default, and the (now stateless) Pinia store are all redundant.

Scope

  • Drop the cache. Remove RegionalMarketCache from the appraisal price path. Every getPrice/getPrices call goes to mammon; rely on mammon's caching. getPrices stays a thin wrapper that batches type ids by 100 (BATCH_SIZE) over getMammonPrices and flattens the results.
  • Drop the client-side Jita default. When no location is chosen, pass locationId through as undefined and let mammon default it (Jita). The generated client already makes locationId optional on currentPrices, so no client change is needed.
  • Collapse the store. useAppraisalStore holds no state after the cache is gone. Replace it with plain exported getPrice/getPrices functions (e.g. in src/market/appraisal/appraisal.ts) and update the three callers.
  • Delete now-dead code:
    • src/market/RegionalMarketCache.ts and its spec src/market/RegionalMarketCache.spec.ts.
    • src/market/market.ts (contains only jitaId).
    • The corresponding export * from './RegionalMarketCache' and export * from './market' lines in src/market/index.ts.

Affected callers

  • src/pages/market/TypeInfo.vueappraisalStore.getPrice(item)getPrice(item).
  • src/market/acquisition/AcquisitionsPanel.vueappraisalStore.getPrices(types)getPrices(types).
  • src/pages/market/CompareAppraisal.vuestore.getPrices passed to compareAppraisal → the exported getPrices function.

Out of scope

  • No changes to mammon or the pricing endpoint; the server-side Jita default is assumed to already work.
  • No changes to compare.ts / PricesForLocation (its locationId stays a required number — compare always supplies explicit locations).
  • No re-introduction of any client-side caching or in-memory dedupe.

Acceptance criteria

  • No RegionalMarketCache anywhere; the class, its spec, and its index.ts export are removed.
  • No jitaId / src/market/market.ts; its index.ts export is removed. No hardcoded Jita id remains on the frontend.
  • useAppraisalStore is gone; getPrice/getPrices are plain functions and the three callers use them directly.
  • Omitting a location relies on the backend default (undefined locationId reaches currentPrices).
  • getPrices still batches by 100.
  • Existing pages (item info, acquisitions, appraisal, compare) still price correctly.
  • npm run build passes.

Related

  • Depends on mammon serving per-location prices with a server-side Jita default when locationId is omitted.
## Summary The appraisal store (`src/market/appraisal/appraisal.ts`) keeps a frontend `RegionalMarketCache` and defaults the market location to Jita **client-side** (`jitaId` in `src/market/market.ts`). Now that mammon serves per-location prices and owns caching — including defaulting an omitted `locationId` to Jita server-side — the frontend cache, the client-side default, and the (now stateless) Pinia store are all redundant. ## Scope - **Drop the cache.** Remove `RegionalMarketCache` from the appraisal price path. Every `getPrice`/`getPrices` call goes to mammon; rely on mammon's caching. `getPrices` stays a thin wrapper that batches type ids by 100 (`BATCH_SIZE`) over `getMammonPrices` and flattens the results. - **Drop the client-side Jita default.** When no location is chosen, pass `locationId` through as `undefined` and let mammon default it (Jita). The generated client already makes `locationId` optional on `currentPrices`, so no client change is needed. - **Collapse the store.** `useAppraisalStore` holds no state after the cache is gone. Replace it with plain exported `getPrice`/`getPrices` functions (e.g. in `src/market/appraisal/appraisal.ts`) and update the three callers. - **Delete now-dead code:** - `src/market/RegionalMarketCache.ts` and its spec `src/market/RegionalMarketCache.spec.ts`. - `src/market/market.ts` (contains only `jitaId`). - The corresponding `export * from './RegionalMarketCache'` and `export * from './market'` lines in `src/market/index.ts`. ### Affected callers - `src/pages/market/TypeInfo.vue` — `appraisalStore.getPrice(item)` → `getPrice(item)`. - `src/market/acquisition/AcquisitionsPanel.vue` — `appraisalStore.getPrices(types)` → `getPrices(types)`. - `src/pages/market/CompareAppraisal.vue` — `store.getPrices` passed to `compareAppraisal` → the exported `getPrices` function. ## Out of scope - No changes to mammon or the pricing endpoint; the server-side Jita default is assumed to already work. - No changes to `compare.ts` / `PricesForLocation` (its `locationId` stays a required `number` — compare always supplies explicit locations). - No re-introduction of any client-side caching or in-memory dedupe. ## Acceptance criteria - [x] No `RegionalMarketCache` anywhere; the class, its spec, and its `index.ts` export are removed. - [x] No `jitaId` / `src/market/market.ts`; its `index.ts` export is removed. No hardcoded Jita id remains on the frontend. - [x] `useAppraisalStore` is gone; `getPrice`/`getPrices` are plain functions and the three callers use them directly. - [x] Omitting a location relies on the backend default (undefined `locationId` reaches `currentPrices`). - [x] `getPrices` still batches by 100. - [x] Existing pages (item info, acquisitions, appraisal, compare) still price correctly. - [x] `npm run build` passes. ## Related - Depends on mammon serving per-location prices with a server-side Jita default when `locationId` is omitted.
Sirttas added the
Status
To Refine
label 2026-07-09 19:30:14 +02:00
Sirttas changed title from Simplify appraisal: drop the frontend price cache and the client-side Jita default to Simplify appraisal: drop the frontend price cache, the client-side Jita default, and the store 2026-07-14 17:59:04 +02:00
Sirttas added Kind/Enhancement and removed
Status
To Refine
labels 2026-07-14 17:59:13 +02:00
Sirttas added the
Priority
Critical
1
label 2026-07-14 23:19:38 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: eveal/gemory#27