Skip to content

[PM-37215] Add USER_EMAIL setting and persist via save_to_state#1163

Open
dani-garcia wants to merge 1 commit into
mainfrom
ps/PM-37215-user-email-setting-key
Open

[PM-37215] Add USER_EMAIL setting and persist via save_to_state#1163
dani-garcia wants to merge 1 commit into
mainfrom
ps/PM-37215-user-email-setting-key

Conversation

@dani-garcia
Copy link
Copy Markdown
Member

@dani-garcia dani-garcia commented Jun 3, 2026

🎟️ Tracking

https://bitwarden.atlassian.net/browse/PM-37215

📔 Objective

Adds a USER_EMAIL persisted setting key in persisted_state.rs and wires the value through SaveStateData so Client::save_to_state writes it alongside USER_ID, BASE_URLS, and ACCOUNT_CRYPTO_STATE. Once available, bw status can read the active user's email from the state registry instead of returning null.

The ticket also calls for populating this value inside the Auth team's from_authenticated_data, which does not exist yet and is part of Auth's work. This PR adds the Platform-side subset (the setting key + the temporary save_to_state persistence) so callers can populate the email today without rework once Auth lands its handler.

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Jun 3, 2026

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 3, 2026

🔍 SDK Breaking Change Detection

SDK Version: ps/PM-37215-user-email-setting-key (96b3974)

⚠️ If breaking changes are detected, a corresponding pull request addressing them must be ready for merge in the affected client repository.

Client Status Details
typescript ✅ No breaking changes detected Compilation passed with new SDK version - View Details
android ✅ No breaking changes detected Compilation passed with new SDK version - View Details

Breaking change detection uses the build of the SDK from this branch, including any incompatibities pre-existing on or merged into this branch. Check the workflow logs to confirm.
Results update as workflows complete.

@dani-garcia dani-garcia added the ai-review-vnext Request a Claude code review using the vNext workflow label Jun 3, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 3, 2026

🤖 Bitwarden Claude Code Review

Overall Assessment: APPROVE

This PR adds a USER_EMAIL setting key in persisted_state.rs and wires the email through SaveStateData so Client::save_to_state persists it alongside USER_ID, BASE_URLS, and ACCOUNT_CRYPTO_STATE. The change is intentionally scoped as a Platform-side subset pending Auth's from_authenticated_data handler, with the corresponding test extended to cover the new field.

Code Review Details

No findings. The change is minimal, follows the existing register_setting_key! pattern, and is covered by an updated unit test that asserts write-back via the registry. The asymmetry between save_to_state (writes email) and load_from_state (does not read it) is intentional and documented in the PR description.

@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 3, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.12%. Comparing base (a2734ac) to head (96b3974).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1163   +/-   ##
=======================================
  Coverage   84.12%   84.12%           
=======================================
  Files         446      446           
  Lines       58817    58835   +18     
=======================================
+ Hits        49478    49496   +18     
  Misses       9339     9339           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@dani-garcia dani-garcia marked this pull request as ready for review June 3, 2026 13:59
@dani-garcia dani-garcia requested a review from a team as a code owner June 3, 2026 13:59
@dani-garcia dani-garcia requested a review from coroiu June 3, 2026 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-review-vnext Request a Claude code review using the vNext workflow

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant