Skip to content

[PM-20012] fix: Incorrect endpoint saved#2796

Draft
LRNcardozoWDF wants to merge 4 commits into
mainfrom
cmcg/pm-20012-fix-incorrect-endpoint-saved
Draft

[PM-20012] fix: Incorrect endpoint saved#2796
LRNcardozoWDF wants to merge 4 commits into
mainfrom
cmcg/pm-20012-fix-incorrect-endpoint-saved

Conversation

@LRNcardozoWDF

@LRNcardozoWDF LRNcardozoWDF commented Jun 16, 2026

Copy link
Copy Markdown
Member

🎟️ Tracking

PM-20012

📔 Objective

We are setting the pre-auth environment URLs when using the autofill. That data is shared with the main app, so if we use the autofill in middle of performing login we will have the wrong environment URLs for the account.

@LRNcardozoWDF LRNcardozoWDF requested review from a team and matt-livefront as code owners June 16, 2026 14:59
@github-actions github-actions Bot added app:password-manager Bitwarden Password Manager app context t:bug Change Type - Bug labels Jun 16, 2026
@github-actions

github-actions Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

🤖 Bitwarden Claude Code Review

Overall Assessment: APPROVE

Reviewed the fix for PM-20012, which removes the setPreAuthURLs(urls:) side effect from loadURLsForActiveAccount() in DefaultEnvironmentService. This prevents the AutoFill extension from overwriting the shared pre-auth environment URLs while a login is in progress in the main app. Verified that setPreAuthURLs is still explicitly invoked in all legitimate pre-auth flows (Landing, StartRegistration, CompleteRegistration), and that the managed-config fallback path in loadURLsForActiveAccount() remains intact since it still reads managed settings directly.

Code Review Details

No actionable findings.

The change is minimal and well-scoped: pre-auth URLs are now only written through the dedicated setPreAuthURLs path rather than as a side effect of loading account URLs. Test coverage is appropriate — the new test_loadURLsForActiveAccount_doesNotUpdatePreAuthURLs test directly asserts the bug fix, and obsolete pre-auth assertions were removed from the affected tests. The initializer signature change is a style-only multi-line formatting adjustment.

urls = .defaultUS
}

await setPreAuthURLs(urls: managedSettingsURLs ?? urls)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔 Are there any downsides to removing this? I think this currently is used so that the pre-auth URLs are updated when you switch the active account (the environment URLs when adding a new account are always set to the last active account). Assuming that's still a requirement, we should account for that before removing this.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You may be right, I didn't test that flow. I'll test that, meanwhile this PR will be in draft. Thank you for bringing this to my attention.

@LRNcardozoWDF LRNcardozoWDF marked this pull request as draft June 17, 2026 13:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app:password-manager Bitwarden Password Manager app context t:bug Change Type - Bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants