fix(webview): avoid data url placeholder for child accounts (#884)#891
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughReplaces the webview placeholder from a Changes
Sequence Diagram(s)sequenceDiagram
participant Webview
participant App (Caller)
participant CDP_Session
participant Browser_Targets
App->>CDP_Session: call placeholder_url(account_id)
CDP_Session-->>App: "about:blank#placeholder-{account_id}"
App->>Webview: load URL "about:blank#placeholder-{account_id}"
Webview->>Browser_Targets: create/load target with URL fragment
CDP_Session->>Browser_Targets: list targets
CDP_Session->>Browser_Targets: match target by URL suffix "#...{account_id}"
Browser_Targets-->>CDP_Session: matched target
CDP_Session->>App: attach to matched target
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@app/src-tauri/src/cdp/session.rs`:
- Around line 52-56: The match is too permissive in target_matches_account_url:
instead of matching target_url.ends_with(&marker) (which can hit non-placeholder
paths), require the fragment boundary by checking for a leading '#' before the
marker; update the check in target_matches_account_url to test for a suffix like
"#{marker}" (or build marker_with_hash = format!("#{}", marker)) and keep the
existing fragment comparison (fragment) as-is so only fragment-based
placeholders match.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 7376ffb5-99ec-40bf-a241-e46d0a891ce8
📒 Files selected for processing (3)
app/src-tauri/src/cdp/mod.rsapp/src-tauri/src/cdp/session.rsapp/src-tauri/src/webview_accounts/mod.rs
Summary by CodeRabbit
Refactor
Tests
Closes #884