Skip to content

Fix stale search results and reset behavior - #21

Merged
wctiger merged 1 commit into
mainfrom
codex/work-on-open-issues
Aug 1, 2026
Merged

wctiger merged 1 commit into
mainfrom
codex/work-on-open-issues

Conversation

@wctiger

@wctiger wctiger commented Aug 1, 2026

Copy link
Copy Markdown
Owner

Motivation

  • Prevent older overlapping search requests from overwriting newer results and ensure the app clears results and errors when returning home or dismissing an error.

Description

  • Add a requestIdRef (useRef) to usePackageSearch and bind it to each searchPackage call to identify and ignore stale responses.
  • Stabilize callbacks by wrapping searchPackage and resetSearch in useCallback and early-return when a response is no longer current.
  • Invalidate pending requests in resetSearch by bumping requestIdRef so late responses cannot repopulate cleared state.
  • Wire the resetSearch call into src/App.tsx so logo clicks and error-dismiss actions call resetSearch() and resetParams() together to fully clear UI and URL state.

Testing

  • Ran bun run lint and it completed successfully.
  • Ran bun run build and build completed successfully with only the standard Vite chunk-size warning.
  • Ran git diff --check and static checks passed (no whitespace/errors reported).

Codex Task

@wctiger
wctiger merged commit dbe4d05 into main Aug 1, 2026
2 checks passed
@wctiger
wctiger deleted the codex/work-on-open-issues branch August 1, 2026 14:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant