Skip to content

[PM-39387] fix: Bump AccountRevisionDate when premium status changes#7966

Open
cyprain-okeke wants to merge 2 commits into
mainfrom
billing/pm-39387/bump-account-revision-date-on-premium-status-change
Open

[PM-39387] fix: Bump AccountRevisionDate when premium status changes#7966
cyprain-okeke wants to merge 2 commits into
mainfrom
billing/pm-39387/bump-account-revision-date-on-premium-status-change

Conversation

@cyprain-okeke

Copy link
Copy Markdown
Contributor

🎟️ Tracking

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

📔 Objective

Premium enable/disable only bumped RevisionDate, but clients gate their catch-up syncs on GET /accounts/revision-date, which returns AccountRevisionDate. When the one-time PremiumStatusChanged push was missed (e.g. an MV3 service worker suspension), every revision-gated sync concluded nothing had changed and the client kept stale premium state until a manual sync.

This change bumps AccountRevisionDate alongside RevisionDate when premium status changes (in UserService premium enable/disable paths and the Stripe CheckoutSessionCompletedHandler), so the clients' existing revision-gated syncs detect the change.

No SQL migration needed: User_Update already persists the AccountRevisionDate column.

Premium enable/disable only bumped RevisionDate, but clients gate their
catch-up syncs on GET /accounts/revision-date, which returns
AccountRevisionDate. When the one-time PremiumStatusChanged push was
missed (e.g. an MV3 service worker suspension), every revision-gated
sync concluded nothing had changed and the client kept stale premium
state until a manual sync. Bumping AccountRevisionDate alongside
RevisionDate lets the clients' existing revision-gated syncs detect the
change. No SQL migration needed: User_Update already persists the
AccountRevisionDate column.
@cyprain-okeke cyprain-okeke added ai-review Request a Claude code review t:feature Change Type - Feature Development labels Jul 13, 2026
@cyprain-okeke cyprain-okeke marked this pull request as ready for review July 13, 2026 13:22
@cyprain-okeke cyprain-okeke requested a review from a team as a code owner July 13, 2026 13:22
@cyprain-okeke cyprain-okeke requested a review from connerbw July 13, 2026 13:22
@codecov

codecov Bot commented Jul 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 61.52%. Comparing base (0fce684) to head (cdeb396).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7966      +/-   ##
==========================================
+ Coverage   61.49%   61.52%   +0.02%     
==========================================
  Files        2253     2253              
  Lines       99103    99103              
  Branches     8960     8960              
==========================================
+ Hits        60945    60969      +24     
+ Misses      36007    35981      -26     
- Partials     2151     2153       +2     

☔ View full report in Codecov by Harness.
📢 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.

@github-actions

github-actions Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

🤖 Bitwarden Claude Code Review

Overall Assessment: APPROVE

This change bumps AccountRevisionDate alongside RevisionDate in the three premium status-change paths (UserService.EnablePremiumAsync/DisablePremiumAsync and the Stripe CheckoutSessionCompletedHandler) so clients' revision-gated syncs detect the change when the one-time push is missed. I verified that both the Dapper User_Update stored procedure and the EF Repository.ReplaceAsync full-entity mapping persist the AccountRevisionDate column, confirming the "no migration needed" claim holds across all four supported databases. New unit tests cover both the enable and disable paths with correct guard setup and meaningful assertions.

Code Review Details

No findings. The change is small, focused, and correctly scoped.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-review Request a Claude code review t:feature Change Type - Feature Development

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants