Repository navigation
Conversation
Preview approval requiredThis pull request comes from a fork, so Mintlify won't build a preview until someone with write access approves commit |
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.
What
Code stays on the last composition selected when source responses arrive out of order. Selecting
groups.htmland thenindex.htmlcan otherwise leave the preview onindex.htmlwhile a delayed response switches Code back togroups.html.Why
The source editor can show and edit a different composition from the one being previewed. Obsolete failed requests can also show errors after a newer composition has loaded.
Related work
Fixes #7431
Searched open and closed issues/PRs by source editor, composition switching, stale responses, the loader symbol, and related work. The existing loading guard in #1964 and startup behavior in #4057 do not handle this response-order race.
How
Give each composition load an ID and invalidate it on project changes or unmount. Only the current load can publish source content or show an error. Current load failures still leave content unloaded and report the failure.
Before
Same fixture, browser, viewport, and response order: select
groups.html, thenindex.html, then release the delayedgroups.htmlresponse. Code selectsgroups.html; the preview still showsindex.html.After
Code keeps
index.htmlselected and shows its source beside the sameindex.htmlpreview.Reproduction script, before result, after result.
Test plan
Vitest prints a teardown-timeout warning on both baseline and patched runs; the patched test command exits successfully. The fix covers requests initiated by the Compositions panel. File-tree and click-to-source loading paths retain their existing ownership behavior.