CCCT-2355 Retry Start Configuration On Missing Integrity Token#3731
CCCT-2355 Retry Start Configuration On Missing Integrity Token#3731shubham1g5 wants to merge 3 commits into
Conversation
Suggested Review OrderReview commit by commit |
📝 WalkthroughWalkthroughThis PR improves integrity token handling and error recovery in the personal ID configuration flow. The API handler now unconditionally records error subcodes before switch evaluation, making them available for all error types. The fragment introduces Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
app/unit-tests/src/org/commcare/fragments/personalId/PersonalIdPhoneFragmentStartConfigurationTest.kt (1)
44-44: 💤 Low valueReminder: Run ktlint after changes.
As per coding guidelines, run
./gradlew ktlintFile -PfilePath=app/unit-tests/src/org/commcare/fragments/personalId/PersonalIdPhoneFragmentStartConfigurationTest.ktto verify formatting.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@app/unit-tests/src/org/commcare/fragments/personalId/PersonalIdPhoneFragmentStartConfigurationTest.kt` at line 44, The test file contains formatting/ktlint issues for the class PersonalIdPhoneFragmentStartConfigurationTest; run the ktlint fixer against this file and apply the suggested formatting changes by executing the project ktlint task for that file (e.g., use ./gradlew ktlintFile -PfilePath=<this test file>) and commit the updated formatting so the class PersonalIdPhoneFragmentStartConfigurationTest conforms to project style.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@app/unit-tests/src/org/commcare/fragments/personalId/PersonalIdPhoneFragmentStartConfigurationTest.kt`:
- Around line 286-310: The new test
testStartConfiguration_missingDataIntegrityHeaders_noToken_retriesAndSucceeds
lacks the QA automation guard, so it will fail when biometric navigation is
skipped in QA runs; add an assumeFalse(BuildConfig.IS_QA_AUTOMATION) at the
start of this test (same approach used in
testStartConfiguration_successResponse_moveToBiometric) so the test is skipped
in QA automation builds and only asserts navigation in normal runs.
---
Nitpick comments:
In
`@app/unit-tests/src/org/commcare/fragments/personalId/PersonalIdPhoneFragmentStartConfigurationTest.kt`:
- Line 44: The test file contains formatting/ktlint issues for the class
PersonalIdPhoneFragmentStartConfigurationTest; run the ktlint fixer against this
file and apply the suggested formatting changes by executing the project ktlint
task for that file (e.g., use ./gradlew ktlintFile -PfilePath=<this test file>)
and commit the updated formatting so the class
PersonalIdPhoneFragmentStartConfigurationTest conforms to project style.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: ec6b9f06-3912-49d8-b13e-f26552193040
📒 Files selected for processing (3)
app/src/org/commcare/connect/network/connectId/PersonalIdApiHandler.javaapp/src/org/commcare/fragments/personalId/PersonalIdPhoneFragment.javaapp/unit-tests/src/org/commcare/fragments/personalId/PersonalIdPhoneFragmentStartConfigurationTest.kt
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3731 +/- ##
============================================
+ Coverage 23.31% 23.36% +0.05%
- Complexity 3929 3938 +9
============================================
Files 924 924
Lines 56190 56210 +20
Branches 6654 6656 +2
============================================
+ Hits 13098 13134 +36
+ Misses 41394 41376 -18
- Partials 1698 1700 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
CCCT-2355
Product Description
Fixes a PersonalID configuration crash where the server rejects the start-configuration request because the integrity token was missing from the request headers. The app now fetches a fresh token and retries the request once instead of showing an error screen.
Some Useful notes to review:
Safety Assurance
Safety story
Automated test coverage
Added tests in
PersonalIdPhoneFragmentStartConfigurationTest