Skip to content

fix(search): a search made from the home page opens without a spinner when its save is answered first - #1733

Merged
sickerine merged 2 commits into
devfrom
fix/qa1204-session
Dec 4, 2026
Merged

sickerine merged 2 commits into
devfrom
fix/qa1204-session

Conversation

@sickerine

Copy link
Copy Markdown
Collaborator

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 (opening in lib/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:

  • New case in 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/research tests: 28 passed. npx tsc --noEmit passes.
  • With the results page's request held back 600 ms in Playwright so the save always answers first: dev showed the spinner for 15 to 18 frames in each of 3 searches, this branch in none of 3.
  • 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.
  • Cross-family review (GPT-6.1 Sol): two findings, both fixed here (imports kept in the store; an edit lost while the read was on its way).

… 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.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Dec 4, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-12-04T08:41:48.238987Z 9eb760b PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Dec 4, 2026

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: fccf0f59-d8f7-4b13-ae84-552fca0e5b5d
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@sickerine
sickerine merged commit faec113 into dev Dec 4, 2026
9 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant