* refactor(frontend): drop TTL resource caches and remove duplicate startup requests
Space-level resource stores (chatResources / editorResources / organization)
cached lists for 60s. Pages that own the data bypassed the cache with force,
while side consumers (chat input bar, selectors) read stale values and relied
on a web of indirect refresh signals. Replace the TTL with in-flight
deduplication plus explicit invalidation:
- add stores/resourceCache.ts: createCachedResource (one request in flight
per resource, force queues behind it, invalidate/markLoaded discard stale
responses) and createKeyedSnapshotCache for per-id details
- rebuild chatResources / editorResources on those primitives; organization
store drops its loadedAt timestamps and uses the request coordinator only
- isFresh -> isLoaded (only "has a snapshot" is meaningful now)
Fix concrete duplicates found on the way:
- /auth/me was fetched twice on every cold load (main.ts + UserMenu); auth
store now dedupes in-flight calls and exposes ensureAuthMe, router hydrate
reuses refreshFromAuthMe instead of a second copy of the persist logic
- /system/info was fetched by menu.vue directly next to editorResources
- /platform/settings rendered Settings.vue as the route component while the
platform layout already mounts it, so two modals were visible and every
settings panel request ran twice; the route now renders an empty view
- components that called listKnowledgeBases / listAgents / getParserEngines /
getPromptTemplates directly now go through the stores
- Input-field no longer force-refreshes models and web-search providers on
"settings closed" / "left settings route"; WebSearchSettings writes back to
the shared snapshot and useTenantModelReadiness derives from the store
Measured with a mock backend: cold load 19 -> 18 requests (/auth/me once),
settings model panel 3 -> 2 (one modal), route changes now refetch lists
(creatChat 3 -> 9, back to KB list 0 -> 4) instead of serving 60s-old data.
* fix(frontend): fence stale responses in the resource caches and /auth/me refresh
Review follow-ups on the TTL removal:
- createKeyedSnapshotCache tracks a per-key revision; invalidate() and a
force read both advance it, so a response that lands after invalidation
or behind a newer request is handed to its caller but never written back
into the snapshot. Previously a KB detail read still in flight during
save could re-pin the pre-save detail until the next explicit invalidate.
- ensureKnowledgeBases / ensureAgents no longer reject when the shared
resource fetch fails; the own list is already applied and the previous
shared snapshot is kept. Callers migrated onto the store (manual editor,
KB selector, FAQ manager, API integration page) had independent failure
handling before. McpServerIntegrationSettings shows empty lists on
failure instead of the last snapshot.
- /auth/me refresh is sequenced via a new createSequencedRefresh helper:
refreshFromAuthMe() always resolves on a request issued after the call
(queued behind an in-flight one), ensureAuthMe() shares in-flight, and
logout() invalidates so a late response cannot re-apply the old session.
Tests: keyed cache invalidate-during-flight and force-overlap; sequencer
refresh ordering, invalidate after logout, and recovery after a failed
in-flight request.
* fix(frontend): refetch models after publishing a catalog change
invalidate() no longer triggers a refetch and the chat input stopped
reloading models when settings close, so the reasoning-level selector kept
stale capabilities after a catalog publish. Force-refresh the snapshot.