Repository navigation
🤖 tests: Storybook draft mocks share one revision sequence per page - #6437
Merged
Merged
Conversation
Refs #6389 --- _Generated with `xum` • Model: `anthropic:claude-opus-5-5` • Thinking: `high`_ <!-- mux-attribution: model=anthropic:claude-opus-5-5 thinking=high -->
Member
Author
|
Perf clearance request for the perf owner (workspace 8e18f4aada). Peer messaging is unavailable from my workspace, so I am posting it here.
Generated with |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Member
Author
|
Perf clearance (perf owner): cleared at
A new head needs a new clearance. Generated with |
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
This PR fixes one of the three Storybook flakes in #6389:
App/Gateway Fast Mode › Phone. The Storybook drafts mock started a new revision sequence for each story. The DraftStore, which is one per page, then applied an older, empty draft view over the text the play was typing. The mock now keeps one revision sequence for the whole page, as a real backend does. Only the Storybook mock changes. Refs #6389:Features/RightSidebar/MemoryTab › EditorandApp/Desktop › SharedBindingare not fixed here.Root cause
createMockDraftsApistarted its revisions at 1 (src/browser/stories/mocks/drafts.ts). TheDesktopandPhonestories use the same workspace ID, andDesktopwrites the draft many times.serverView, with its revision. On the new client's snapshot it resetsentry.revisionbut keepsserverView, becauseapplyServerStatereplaces it only when the new revision is not lower (src/browser/stores/DraftStore.ts,applyServerState).Phone, every write reply then had a lower revision than the kept view fromDesktop. SoapplyWriteReplyapplied that kept view, which was empty, over the composer whenever no newer keystroke was pending./ultrafast, the composer was wiped in the middle, and the rest of the keystrokes sentfastorstas a message. The tier stayedpriority:expected 'priority' to be 'ultrafast'.I traced this with scratch instrumentation in the play. A failing run shows
applyWriteReplyfor a reply{revision: 3, text: "/ultrafa"}callingapplyServerState(entry, ""), and the composer value turning""in the same millisecond.A real backend does not regress:
DraftServiceseeds its revisions from its start time. I first tried that in the mock (Date.now()), but stories freezeDate.now(storyTime.ts), so every story got the same seed and the failure stayed. A module-level counter is the fix.Validation
Old build (main) and new build, served with
http-server,test-storybook --testTimeout 30000, bun 1.4.3, shared 32-core host. Rounds were interleaved so that both builds saw the same load.App.gatewayFastMode.stories.tsxalone, 6 copies in parallel, 15 roundsI counted only full-suite runs without host overload (10 or fewer failures). Runs with
page.gototimeouts across the suite are excluded on both sides.make static-checkpassed.Not fixed here
Features/RightSidebar/MemoryTab › Editor("yaml block is not highlighted yet") still failed 2 of 21 full-suite runs with this change, and 2 of 18 without it. Its play waits 5 s for Shiki tokens. The code-block highlight has its own 5 s budget and falls back to plain text, so a longer wait in the play would not help. Not root-caused yet.App/Desktop › SharedBinding("Unable to find a label with the text of: Desktop session preview") did not fail in these 39 runs. Not root-caused.Risks
Storybook only. The revision numbers in story mocks now keep growing across stories in a page. No story reads them.
Generated with
xum• Model:anthropic:claude-opus-5-5• Thinking:high