Introduces cacheableModels.js as the source of truth for which models the client caches in IDB and how to dispatch their revalidate actions. DataManager derives modelsToSync from the registry and creates object stores idempotently, so adding new cached models needs only one place to change plus a one-time DATA_VERSION bump. Also fixes two latent bugs that the upcoming boot-hydration relies on: setCacheKeys now awaits all per-key writes (was async-forEach with no await), and replace awaits clear before push (avoids ConstraintError on rapid refetches).
10 lines
542 B
JavaScript
10 lines
542 B
JavaScript
// Bump DATA_VERSION whenever a new object store is added to the IDB schema
|
|
// (the `upgrade()` callback in DataManager only runs when the stored DB
|
|
// version is less than the requested version). The upgrade body itself is
|
|
// idempotent — it conditionally creates each store via
|
|
// `objectStoreNames.contains(name)` — so a single bump is enough to add any
|
|
// number of new stores without losing existing data.
|
|
//
|
|
// Wednesday, 21 May 2026 — bumped to add canned_response + account_user stores
|
|
export const DATA_VERSION = '1747785600';
|