Repository navigation
refactor(app): record /btw chats without waiting for the store to load - #53312
Merged
Merged
Conversation
Writes before a session store loads already queue and land in the batch that marks it ready, and the panel keeps a not-yet-loaded tab hidden, so ask() records the chat and opens its tab at once instead of waiting through a reactive root. Navigating away before load now keeps the chat rather than cancelling it.
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
Follow-up to #53270.
/btwno longer waits for the session's store to load before recording a chat.ask()pushes the chat and opens its tab immediately, in one batch, and starts the request. It replaces aPromise+createRoot+ abort-signal + twocreateKeyedwatchers that waited forstore.ready().Persisted.updatebefore load already queues, and the queue applies in the same batch that marks the store ready, so the chat lands over the stored value with no ready-but-missing gap.saved(session)returns one stable handle per session for as long as its tab is open.generate()now takes the question as a parameter instead of reading it back from the store, which may still be loading. Retry reads the stored question and passes it in.ask()is now synchronous, so it no longer holds the composer's submit lock.Validation
/btwe2e keeper (btw-sidebar.spec.ts): 4 passed.packages/appandpackages/gui-extensionstypechecks,lint:changed, and Prettier passed.extension-host.spec.ts, anupdatebefore load applies once it loads). Native desktop was not exercised.