-
Notifications
You must be signed in to change notification settings - Fork 3
Lazy mod metadata load can fetch alias target instead of concrete loaded build #95
Description
Summary
ensureModsLoaded() may fetch all_mods.json using an alias (stable/nightly) instead of the concrete build that was already loaded in setVersion.
When aliases move (or cache differs), this can produce a mismatch between:
- core dataset (
all.json) currently rendered, - lazy-loaded mod metadata (
all_mods.json) fetched later.
Relevant code
src/data.tsinensureModsLoaded():const modsVersion = startData.fetching_version ?? startData.build_number;
If fetching_version is an alias (stable/nightly), it wins over build_number.
Why this is problematic
With service worker/workbox caching, alias and concrete build URLs can be cached very differently. A delayed metadata fetch can resolve to newer/other data than the already-loaded concrete build.
Steps to Reproduce (deterministic with mocked responses)
- Call
setVersion(...)through alias (e.g.stable) sofetching_versionis set to alias whilebuild_numberresolves to concrete build. - Return
all.jsonfor build A during initial load. - Before opening Mod Selector, make alias endpoint for
all_mods.jsonreturn build B metadata. - Trigger
ensureModsLoaded()(open Mod Selector). - Observe metadata now corresponds to alias target B, not loaded core build A.
Actual
Lazy metadata load prefers alias and can drift from loaded build.
Expected
When core data is already loaded, lazy mod metadata fetch should be pinned to the same concrete build to guarantee consistency.
Notes
If product direction intentionally prefers alias continuity over concrete pinning, this still needs explicit consistency handling and user-facing guarantees (because mixed-basis data is otherwise possible).