Skip to content

[PM-36643] refactor: Extract premium checkout debounce interval to Constants#2632

Merged
KatherineInCode merged 6 commits into
mainfrom
pm-36643/billingservicetests
May 12, 2026
Merged

[PM-36643] refactor: Extract premium checkout debounce interval to Constants#2632
KatherineInCode merged 6 commits into
mainfrom
pm-36643/billingservicetests

Conversation

@KatherineInCode
Copy link
Copy Markdown
Contributor

@KatherineInCode KatherineInCode commented May 11, 2026

🎟️ Tracking

PM-36643

📔 Objective

Extracts the hardcoded 300 ms debounce interval in DefaultBillingService.premiumCheckoutStatusPublisher() into Constants.premiumCheckoutStatusDebounceInterval (typed as DispatchQueue.SchedulerTimeType.Stride) and wires it as the default value for the existing injectable debounceInterval parameter. Also adds line-wrapping style and magic-number constant guidance to .claude/CLAUDE.md.

@KatherineInCode KatherineInCode added the ai-review-vnext Request a Claude code review using the vNext workflow label May 11, 2026
@github-actions github-actions Bot added app:password-manager Bitwarden Password Manager app context t:tech-debt Change Type - Tech debt t:llm Change Type - LLM related change (e.g. CLAUDE.md files) labels May 11, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 11, 2026

🤖 Bitwarden Claude Code Review

Overall Assessment: APPROVE

This PR extracts the hardcoded 300 ms debounce interval in DefaultBillingService.premiumCheckoutStatusPublisher() into Constants.premiumCheckoutStatusDebounceInterval and wires it as the default for the existing injectable debounceInterval initializer parameter. It also documents the magic-number-to-Constants rule in .claude/CLAUDE.md. The change preserves behavior exactly (same value, same type), and the only production call site relies on the default while the test suite continues to inject its own faster interval.

Code Review Details

No issues found.

  • Type match: parameter and constant both DispatchQueue.SchedulerTimeType.Stride.
  • Value preserved: .milliseconds(300) unchanged.
  • Placement: alphabetically positioned in Constants.swift between pbkdf2Iterations and premiumUpgradeBannerAccountAge.
  • Module choice: PM-specific value correctly placed in the BitwardenShared Constants extension rather than BitwardenKit, consistent with the new CLAUDE.md guidance.
  • Tests: BillingServiceTests injects .milliseconds(100) explicitly and is unaffected by the default change.

@KatherineInCode KatherineInCode changed the title [PM-36643] test: Fix flaky BillingServiceTests [PM-36643] refactor: Extract premium checkout debounce interval to Constants May 11, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 11, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.27%. Comparing base (d61c576) to head (cb738be).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2632      +/-   ##
==========================================
- Coverage   87.31%   86.27%   -1.04%     
==========================================
  Files        1912     2137     +225     
  Lines      170379   184896   +14517     
==========================================
+ Hits       148759   159512   +10753     
- Misses      21620    25384    +3764     

☔ 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.

@andrebispo5
Copy link
Copy Markdown
Contributor

Missed this one, thank you!

@KatherineInCode KatherineInCode marked this pull request as ready for review May 12, 2026 13:49
@KatherineInCode KatherineInCode requested review from a team and matt-livefront as code owners May 12, 2026 13:49
Copy link
Copy Markdown
Contributor

@andrebispo5 andrebispo5 left a comment

Choose a reason for hiding this comment

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

@KatherineInCode looks good only thing missing is fixing the PR labels 👍

@KatherineInCode KatherineInCode removed the t:llm Change Type - LLM related change (e.g. CLAUDE.md files) label May 12, 2026
@KatherineInCode KatherineInCode merged commit 8e761e7 into main May 12, 2026
18 of 19 checks passed
@KatherineInCode KatherineInCode deleted the pm-36643/billingservicetests branch May 12, 2026 15:36
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 app:password-manager Bitwarden Password Manager app context t:tech-debt Change Type - Tech debt

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants