Skip to content

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

Merged
dani-garcia merged 1 commit into
mainfrom
ps/PM-37215-user-email-setting-key
Jun 8, 2026
Merged

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

Conversation

@dani-garcia

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

Copy link
Copy Markdown
Member

🎟️ 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

sonarqubecloud Bot commented Jun 3, 2026

Copy link
Copy Markdown

@github-actions

github-actions Bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

🔍 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

github-actions Bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

🤖 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

codecov Bot commented Jun 3, 2026

Copy link
Copy Markdown

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
@dani-garcia dani-garcia merged commit 11f43b1 into main Jun 8, 2026
78 checks passed
@dani-garcia dani-garcia deleted the ps/PM-37215-user-email-setting-key branch June 8, 2026 09:21
bw-ghapp Bot added a commit to bitwarden/sdk-swift that referenced this pull request Jun 8, 2026
dani-garcia added a commit that referenced this pull request Jun 8, 2026
## 🎟️ Tracking

<!-- Paste the link to the Jira or GitHub issue or otherwise describe /
point to where this change is coming from. -->

## 📔 Objective

Fix failures on main due to the merge of #1104 and #1163 

## 🚨 Breaking Changes

<!-- Does this PR introduce any breaking changes? If so, please describe
the impact and migration path for clients.

If you're unsure, the automated TypeScript compatibility check will run
when you open/update this PR and provide feedback.

For breaking changes:
1. Describe what changed in the client interface
2. Explain why the change was necessary
3. Provide migration steps for client developers
4. Link to any paired client PRs if needed

Otherwise, you can remove this section. -->
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.

2 participants