Repository navigation
fix(search): a search made from the home page opens without a spinner when its save is answered first - #1733
Merged
Merged
Conversation
… when its save is answered first The session dropped a new search's local copy once Convex answered its save and no page was reading it. The results page it was made for often mounts after that answer (the save took about 140 ms, the navigation about 220 ms), so its gate waited for Convex to read the search back and showed the page spinner for 130 to 180 ms. A made search now stays readable until a page opens it, and goes with a delete.
… a read as on its way until Convex answers Imports dispatch createSearch too, so every imported search stayed in the store; and a read handed the made search counted as settled, so an edit made before Convex answered fell back until it did. The session now keeps only the last search addSearchResult made, in one slot, and a watch is read once Convex has answered (heard), whatever it was shown meanwhile.
Codex Review Summary: ✅ CompletedThis 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. |
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
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.
Found by the daily QA of 4 December, checking #1729 ("A search this browser already holds shows at once").
A signed-in search from
/sometimes showed the page spinner over the results area for 130 to 180 ms before the results page drew. It happened whenever Convex answered the new search's save before the results page mounted: 3 of 7 runs on dev, where the save took about 140 ms and the navigation about 220 ms.The session kept a new search in the store only while its save was pending, or while a page was already reading it. Answered with no page reading it, the search left the store, so the results gate (
useResultsGate) found it neither saved nor read and waited for Convex to read it back. The search a page made last (addSearchResult) now stays readable after its save is answered, until a page opens it (openinginlib/research/session.ts). Only that one is kept: searches taken in from this browser's records aren't. A completed delete drops it. A read handed it counts as on its way until Convex answers (heard), so a change made on the page meanwhile isn't lost in between.Checks:
lib/research/session.test.ts: red on dev (the search is gone once its save is answered), green here; it also covers a change made before Convex reads the search back, and an imported search not being kept.lib/researchtests: 28 passed.npx tsc --noEmitpasses.npm run verify -- shift /with a search typed and sent: passes in Chromium and Firefox. The moves it lists are the results page's own loading, which dev has too.