Repository navigation
Conversation
…e the editor Outside the Site editor the Settings modal caches the site document in a standalone store and never refetched it, so after a site import, a plugin install or a data-workspace write to site tables it kept showing (and saving on top of) the pre-import document until a full page reload. Any CMS_SITE_RELOAD_EVENT other than the store's own save announcement now marks the cached copy stale (also while the first load is in flight); the next render refetches after pending saves have settled, immediately while the modal is open. A load whose fetch started before a save discards its response and fetches again, so it cannot roll back that save or rewind its shell conflict base. The test preload resets the store between tests. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Mineorey
marked this pull request as ready for review
October 12, 2026 15:50
This branch has not been deployed
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.
Summary
What. On every admin page except the Site editor, the Settings modal works on a standalone draft store (
useSiteSettingsController). That store loaded the site document once and kept it. Now:CMS_SITE_RELOAD_EVENTmarks the cached documentstale: a site import, a plugin install, or a data-workspace write to site tables. This includes an event that arrives while the first load is still in flight. The store's own save announcement does not count.shellBaseSeq).storeIsolation.ts) now resets the draft store between tests. To allow this, the store is exported.Why. If you opened Settings before importing a site, it kept showing the pre-import document (name, settings, classes) until a full page reload. Worse, the next settings save was built on top of that outdated copy.
Impact. No change on the Site editor, which reads from the editor store. On other pages, Settings now shows the current site after outside writes. No API, schema or data changes.
Verification
Run in the project's Bun dev container on this branch:
bun run build: passesbun test --timeout 60000: 7125 pass, 2 fail. Both failures are environment-related and also fail onmainin the same container: the circular-dependency check hits its internal 15 s timeout, and thepixel-art-icons.gitignorefreshness check needsgit, which the container doesn't have.bun run lint: cleansrc/__tests__/settings/siteSettingsReload.test.tsx(5 cases: reload after an import, reload while open, no refetch after its own save, import during the first load, stale load vs. a newer save). 4 of the 5 fail against the old controller.Checklist
docs/editor.md, Settings data source).For transparancy: Created with Claude Code