fix: consume repeated YouTube browser handoffs - #36
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: be5ba97d2e
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| } | ||
|
|
||
| handledRequestRef.current = imported.requestId; | ||
| const nextSearch = stripBrowserYoutubeImportParams(search); |
There was a problem hiding this comment.
Parse the current search before consuming the handoff
When a second shell navigation arrives after this render captured request A but before the passive effect executes, window.location.search already contains request B while search still contains A. This line derives an empty query from stale A and the following replaceState overwrites B, so the newer handoff is never consumed or retained. Read and strip the current window.location.search inside the effect, using useSearch() only to trigger reruns.
AGENTS.md reference: AGENTS.md:L243-L247
Useful? React with 👍 / 👎.
Summary
Installed failure evidence
Validation