Repository navigation
Fix infinite UA-policy restart loop on Google Sheets destinations - #9483
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThe browser user-agent policy now treats an empty custom user agent as the WebKit default and prevents repeated restarts for the same navigation destination. Navigation delegates pass requests and main-frame information directly to the policy. Tests cover Sheets navigation and later restart eligibility. ChangesBrowser user-agent policy
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: Important Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (2 errors, 1 warning)
✅ Passed checks (22 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Restore the original navigation-action API and remove the regression test that encoded the same-URL stale-identity fallback. Keep PR #9482 nil/empty normalization as the sole convergence rule.
On some macOS versions WebKit reports the native identity as "" rather than nil after a restart clears
customUserAgent. The policy checkcustomUserAgent != resolvedUserAgentthen never converges for destinations resolved towebKitDefault(like docs.google.com), so every policy pass cancels the navigation and reloads — the Sheets pane hangs and the main thread spins at ~100% CPU.webKitDefaultdestinations no longer register a mismatch.restartNavigationForBrowserUserAgentPolicyIfNeededto take the request and main-frame flag directly so the loop guard is testable without constructing aWKNavigationAction.Added tests covering the empty-identity case and the restart-at-most-once behavior.
Fixes #9462
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by cubic
Fixes an infinite user‑agent policy restart loop on Google Sheets (docs.google.com) that froze the pane and pegged CPU on some macOS versions. Treats empty identities correctly and limits restarts so navigation proceeds. Fixes #9462.
Bug Fixes
customUserAgentas nil when comparing againstwebKitDefault.Refactors
restartNavigationForBrowserUserAgentPolicyIfNeededto takerequestandtargetFrameIsMainFramedirectly for easier testing and clearer logic.Written for commit 1f93491. Summary will update on new commits.