fix(extension): avoid same-url navigation timeout#377
fix(extension): avoid same-url navigation timeout#377jackwener merged 2 commits intojackwener:mainfrom
Conversation
jackwener
left a comment
There was a problem hiding this comment.
Deep review from my side: the same-URL timeout fix is directionally right, but the original normalization was a bit too broad. I pushed a follow-up commit () that keeps the root slash canonicalization while preserving hash-route and non-root path distinctions, and added targeted extension tests for those cases.
jackwener
left a comment
There was a problem hiding this comment.
Deep review from my side: the same-URL timeout fix is directionally right, but the original normalization was a bit too broad. I pushed a follow-up commit (e8bb218) that keeps the root slash canonicalization while preserving hash-route and non-root path distinctions, and added targeted extension tests for those cases.
|
Closing per maintainer request — too many formatting/style issues in the diff. Will redo the fix in a cleaner PR. |
This reverts commit b7ada0e.
…ut (#380) * Revert "fix(extension): avoid same-url navigation timeout (#377)" This reverts commit b7ada0e. * fix(extension): avoid same-url navigation timeout - Add normalizeUrlForComparison for minimal URL canonicalization (root slash + default port only; preserves hash and non-root paths) - Fast-path: skip navigation when tab is already at the target URL - Rewrite wait logic with finish() pattern to prevent double-resolve - Handle both same-URL and redirect scenarios in navigation listener - Add regression tests for same-URL and hash-route distinction
Summary
Fix a browser-bridge navigation bug where navigating to the same URL (or a canonicalized equivalent like:
https://example.comhttps://example.com/can wait for the full 15s timeout.
What changed
URL
Local impact
While reproducing this issue with browser-backed commands, I observed that same-URL navigation could add an
unnecessary ~15s delay before the next step ran.
After this fix, local verification showed:
Validation
npx tsc --noEmitnpm testnpm run test:adapterbackground.tscd extension && npm run typecheck && npm run buildNote
While investigating this, I also noticed some commands may do redundant command-level navigation on top of framework
pre-navigation (for example
bilibili/hot). I intentionally left adapter-level behavior changes out of this PR tokeep it focused on the browser bridge bug.