Skip to content

fix(web): preserve predictor results after rank flush#24

Draft
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/critical-bug-investigation-695c
Draft

fix(web): preserve predictor results after rank flush#24
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/critical-bug-investigation-695c

Conversation

@cursor
Copy link
Copy Markdown

@cursor cursor Bot commented May 30, 2026

Bug and impact

When a user edits the focused rank field and clicks Predict before the URL-backed state catches up, the app flushes the draft rank and submits the prediction with that new rank. If the API responds before router.replace updates rank in the URL, the subsequent URL sync changes the hook input key after the request has already cleared its in-flight marker, causing the successful result to be reset to null. This can make a successful prediction appear empty for a common predictor flow.

Root cause

usePredictorQuery only protected input-key changes that matched the currently in-flight request. It did not remember that a just-settled response belonged to the same input key that the URL was about to adopt.

Fix

Track the latest settled prediction input key and treat it as valid during input-key reconciliation, so URL catch-up for the same flushed rank does not clear the response. The normal reset behavior is preserved for genuinely different inputs.

Validation

  • pnpm --filter @ejam/web typecheck
  • pnpm --filter @ejam/web lint
  • pnpm --filter @ejam/web build
Open in Web View Automation 

Co-authored-by: sh <su6u@users.noreply.github.com>
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