Repository navigation
fix(vue): read the async data on screen again when its scope moves - #388
Merged
Merged
Conversation
Upd4ting
marked this pull request as ready for review
November 20, 2026 14:43
Upd4ting
enabled auto-merge
November 20, 2026 14:43
Upd4ting
added a commit
to AntelopeJS/dms-saas
that referenced
this pull request
Nov 20, 2026
Pin @antelopejs/dms-frontend 0.11.9-next.318.g5775697 (AntelopeJS/dms-frontend#388). Its setDmsAsyncDataScope keeps the data that mounted readers show under the new account and workspace and reads it again, instead of leaving it idle. The sidebar switcher stays mounted across an account change made without a page reload, so on 0.11.8 it showed its skeleton forever.
Merged
5 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
W5a773c8b-2, root cause of W5a773c8b-1 (the dms-saas sidebar workspace switcher loading forever after the session's account or workspace changes without a page reload).
⚠ sensitive: changes what async data a component shows across an account or workspace switch (tenancy isolation of cached data)
Summary
When the async data scope moves, data a caller still shows is now read again in the new scope.
Before,
setDmsAsyncDataScopecleared every keyed entry and emptiedruntime.asyncData. A component still on screen kept its cleared entry (statusidle, datanull), and nothing read it again until the component's own key changed. In dms-saas,reconcileSessionmoves the scope after another tab switches account, and the workspace switcher at/api/saas/workspaces/minestayed loading. A call without a key was not in the map at all, so it kept the previous scope's data under the new scope.setDmsAsyncDataScopenow walksruntime.boundAsyncData, the entries some caller shows:useDmsDataand a new caller of the key share it.execute()stays unread.A caller with a reactive key shows the previous key's data until its new key settles. When the scope moved during that wait, it kept showing the previous scope's data. It now drops that data once its current key leaves
pending, so a clear back toidledrops it too.runtime.boundAsyncDatais now typed as the set of entries it holds. That type is internal to the runtime, so no caller changes.flowchart TD S["setDmsAsyncDataScope(other)"] --> C[collect the entries a caller shows, noting which had loaded or were loading] C --> X[clear every entry: default data, runs aborted] X --> K[store each shown keyed entry under its key in the new scope] K --> L{had it loaded or was it loading?} L -->|yes| R["load(): status pending, then the new scope's data"] L -->|"no (waits for execute())"| I[stays idle]Related issue
W5a773c8b-2, from W5a773c8b-1. No GitHub issue: the orchestrator tracks the task.
Verification
Tests in
tests/vue-async-data-revalidate-scope.test.mts,describe("Async data on a scope move").Before,
data-access.tsandasync-data.tsas onmain(data-access.tsis the same as onv0.11.8):After:
Each test fails on a wrong implementation, checked by mutating the fix: loading every shown entry fails the
execute()test; skipping the clear fails the mounted-component and late-answer tests; storing nothing back under the new scope fails the mounted-component test (useDmsDatafinds nothing); clearing only the keyed map fails the keyless test; dropping carried data only once the new key settles fails the reactive-key test.Local:
pnpm run typecheckpasses,oxlintandoxfmtpass on the changed files,pnpm test(4 workers) runs 991 tests with 0 failures.Attention
Checklist
Follow-ups