Skip to content

Show Email OTP Countdown Immediately After Screen Recreation - #3942

Merged
conroy-ricketts merged 2 commits into
masterfrom
fix-email-otp-countdown-after-recreation
Oct 2, 2026
Merged

conroy-ricketts merged 2 commits into
masterfrom
fix-email-otp-countdown-after-recreation

Conversation

@conroy-ricketts

Copy link
Copy Markdown
Contributor

Product Description

After the email verification screen is recreated (font size or dark mode change, or the app being reclaimed in the background), the resend countdown now shows straight away instead of being blank for about 100ms.

Technical Summary

The email screen's first countdown update was posted with a 100ms delay, so a restored view stayed blank until it fired. The phone verification screen already avoids this by updating before starting its timer; this brings the email screen in line.

Why this fails the unit tests in #3929: a server-supplied wait survives a configuration change reads the countdown right after recreate() without advancing Robolectric's clock. On master it only passes because the app bar's elevation animation moves the fake clock about 195ms during recreation, past the 100ms delay. #3929 moves PersonalID onto ConnectTheme, whose Widget.Connect.AppBarLayout removes that animation, so only about 45ms pass and the test reads the still-blank view. This PR should merge before #3929.

Safety Assurance

Safety story

What gives confidence

Risks to review

  • The first tick now runs synchronously from onResume and requestOtp, before the 1s ticks start.

Automated test coverage

No new tests; the existing saved-state test covers the restored countdown once #3929's theme removes the incidental clock advance.

🤖 Generated with Claude Code

…mes, so a restored wait is never blank after recreation.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@conroy-ricketts conroy-ricketts self-assigned this Oct 2, 2026
@conroy-ricketts
conroy-ricketts marked this pull request as ready for review October 2, 2026 15:12
@coderabbitai

coderabbitai Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

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: c16d970d-be3b-4cb1-bfbe-91574fcb3cd2

📥 Commits

Reviewing files that changed from the base of the PR and between 80d5a4e and f8d1a25.

📒 Files selected for processing (1)
  • app/src/org/commcare/fragments/personalId/BasePersonalIdEmailVerificationFragment.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

resumeResendTimer now runs the timer runnable immediately instead of delaying its first execution by 100 ms. The runnable continues to schedule subsequent countdown updates.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~3 minutes

Change: Bug fix

Suggested reviewers: shubham1g5

Merge Risk: ⚪ Minimal · up to f8d1a

The resend countdown starts immediately after the screen resumes, and repeated resumes do not create duplicate timer callbacks. No concrete issue remains to resolve before merging.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

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 2 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 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 clearly describes the primary change: showing the email OTP countdown immediately after screen recreation.
Description check ✅ Passed The description covers the product impact, technical rationale, safety considerations, test results, and known risk. It omits a direct ticket or document link and does not complete the review checkbox…
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


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 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 36.83%. Comparing base (a7575c7) to head (d329970).
⚠️ Report is 9 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #3942      +/-   ##
============================================
- Coverage     36.86%   36.83%   -0.03%     
+ Complexity     6747     6743       -4     
============================================
  Files          1032     1032              
  Lines         60857    60860       +3     
  Branches       7399     7399              
============================================
- Hits          22432    22416      -16     
- Misses        35825    35844      +19     
  Partials       2600     2600              

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

@conroy-ricketts
conroy-ricketts merged commit caeb551 into master Oct 2, 2026
8 checks passed
@conroy-ricketts
conroy-ricketts deleted the fix-email-otp-countdown-after-recreation branch October 2, 2026 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants