Skip to content

Personal ID: Move to the forgot backup code flow when locked account for an user with email - #3962

Open
shubham1g5 wants to merge 2 commits into
commcare_2.65from
CCCT-2912_locked_account_fixes
Open

shubham1g5 wants to merge 2 commits into
commcare_2.65from
CCCT-2912_locked_account_fixes

Conversation

@shubham1g5

@shubham1g5 shubham1g5 commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Product Description

https://dimagi.atlassian.net/browse/CCCT-2912

Spec

Bumps the API version to 3.0 for Personal ID endpoints.

Safety Assurance

Safety story

  • manual Testing is TBD on web changes but changes are verified by test for now
  • impact radius is bounded by locked account error on the backup code page

Labels and Review

  • Do we need to enhance the manual QA test coverage ? If yes, RELEASES.md is updated accordingly
  • Does the PR introduce any major changes worth communicating ? If yes, RELEASES.md is updated accordingly
  • Risk label is set correctly
  • The set of people pinged as reviewers is appropriate for the level of risk of the change

@shubham1g5 shubham1g5 changed the title Ccct 2912 locked account fixes Personal ID: Move to the forgot backup code flow when locked account for an user with email Oct 9, 2026
@shubham1g5 shubham1g5 added the skip-integration-tests Skip android tests. label Oct 9, 2026
@coderabbitai

coderabbitai Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1fb4319a-8078-49e7-8ced-4c22e544c468
📥 Commits

Reviewing files that changed from the base of the PR and between 861d0bb and c2432b2.

📒 Files selected for processing (13)
  • app/res/values-es/strings.xml
  • app/res/values-fr/strings.xml
  • app/res/values-ha/strings.xml
  • app/res/values-hi/strings.xml
  • app/res/values-lt/strings.xml
  • app/res/values-no/strings.xml
  • app/res/values-pt/strings.xml
  • app/res/values-sw/strings.xml
  • app/res/values-ti/strings.xml
  • app/res/values/strings.xml
  • app/src/org/commcare/connect/network/personalId/PersonalIdApiClient.java
  • app/src/org/commcare/fragments/personalId/PersonalIdBackupCodeFragment.kt
  • app/unit-tests/src/org/commcare/fragments/personalId/PersonalIdBackupCodeFragmentRecoveryTest.kt

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The PersonalID API client version changes from 2.0 to 3.0. When backup-code confirmation returns ACCOUNT_LOCKED_ERROR and a masked email is available, the fragment displays a locked-code toast and opens the existing email recovery flow. Localized messages and a recovery test are added.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Sequence Diagram(s)

sequenceDiagram
  participant BackupCodeFragment
  participant PersonalIdApiClient
  participant EmailOtpScreen
  BackupCodeFragment->>PersonalIdApiClient: Submit backup-code confirmation
  PersonalIdApiClient-->>BackupCodeFragment: Return ACCOUNT_LOCKED_ERROR
  BackupCodeFragment->>BackupCodeFragment: Show locked-code toast
  BackupCodeFragment->>EmailOtpScreen: Open recovery with masked email
Loading

Possibly related PRs

Suggested reviewers: conroy-ricketts

Merge Risk: ⚪ Minimal · up to c2432

Users with a locked backup code and a masked email can proceed to email recovery. The reviewed evidence establishes no concrete defect requiring this draft to be held.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 8 functions across 3 files. (10 skipped: 1… Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check Warning The description includes the ticket, specification, safety story, and review labels. It does not include the required Technical Summary heading or Automated test coverage section, and the Product Desc… Add a Technical Summary section with the rationale and design decisions. Add an Automated test coverage section that names the recovery test and the conditions it verifies. Update the Product Description to describe the locked-account user …
✅ Passed checks (3 passed)
Check name Status Explanation
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Title check Passed The title identifies the main change: moving users with locked accounts and email addresses to the forgot-backup-code flow. The wording is grammatically awkward but remains specific and understandable…
Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 8 functions across 3 files. (10 skipped: 10 unsupported.)

Full details: Description check

Explanation

The description includes the ticket, specification, safety story, and review labels. It does not include the required Technical Summary heading or Automated test coverage section, and the Product Description does not clearly describe the user-facing locked-account flow.

Resolution

Add a Technical Summary section with the rationale and design decisions. Add an Automated test coverage section that names the recovery test and the conditions it verifies. Update the Product Description to describe the locked-account user flow and API version change. Clarify the manual-testing status and explain any remaining coverage gap.

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Oct 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 37.43%. Comparing base (f4b6c1b) to head (c2432b2).
⚠️ Report is 7 commits behind head on commcare_2.65.

Additional details and impacted files
@@                 Coverage Diff                 @@
##             commcare_2.65    #3962      +/-   ##
===================================================
+ Coverage            37.32%   37.43%   +0.10%     
- Complexity            6864     6874      +10     
===================================================
  Files                 1034     1034              
  Lines                61094    61101       +7     
  Branches              7472     7474       +2     
===================================================
+ Hits                 22802    22871      +69     
+ Misses               35637    35560      -77     
- Partials              2655     2670      +15     

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

@shubham1g5
shubham1g5 marked this pull request as ready for review October 9, 2026 05:21
@shubham1g5
shubham1g5 requested review from a team and conroy-ricketts and removed request for a team October 9, 2026 05:21

@conroy-ricketts conroy-ricketts left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, but think we should not merge until it can be tested

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

Labels

skip-integration-tests Skip android tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants