Skip to content

Conversation

@shubham1g5
Copy link
Contributor

Product Description

We were using incorrect key for sub error code

Labels and Review

  • Do we need to enhance the manual QA test coverage ? If yes, the "QA Note" label is set correctly
  • Does the PR introduce any major changes worth communicating ? If yes, the "Release Note" label is set and a "Release Note" is specified in PR description.
  • Risk label is set correctly
  • The set of people pinged as reviewers is appropriate for the level of risk of the change

@coderabbitai
Copy link

coderabbitai bot commented Oct 14, 2025

📝 Walkthrough

Walkthrough

The change updates error handling in PersonalIdApiHandler.java for INTEGRITY_ERROR responses. The handler now reads the sub-error code from the JSON field error_sub_code instead of sub_code. The extracted sub-error code continues to be logged, stored in session state, and used to direct the INTEGRITY_ERROR failure flow. No public APIs or declarations were altered, and overall control flow remains the same.

Sequence Diagram(s)

sequenceDiagram
  participant Client as Client
  participant Handler as PersonalIdApiHandler
  participant Server as ID Service
  participant Session as Session State
  participant Logger as Logger

  Client->>Handler: Submit request
  Handler->>Server: HTTP request
  Server-->>Handler: Error response (INTEGRITY_ERROR, error_sub_code)
  alt INTEGRITY_ERROR
    Handler->>Handler: Parse error_sub_code (changed from sub_code)
    Handler->>Logger: Log INTEGRITY_ERROR with subErrorCode
    Handler->>Session: Store subErrorCode
    Handler-->>Client: Invoke integrity error failure path
  else Other error
    Handler-->>Client: Handle via existing paths
  end

  note over Handler,Session: Changed field source: error_sub_code (was sub_code)
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested labels

skip-integration-tests

Suggested reviewers

  • Jignesh-dimagi
  • pm-dimagi
  • avazirna

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Description Check ⚠️ Warning The PR description only includes a brief product description and label checklist, but omits required sections like Technical Summary, Feature Flag, Safety Assurance details, Automated Test Coverage, and QA Plan from the repository template. Please expand the description to include a Technical Summary with rationale and ticket reference, specify any Feature Flags, detail the Safety Assurance story, Automated test coverage, and a QA Plan as outlined in the template.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (1 passed)
Check name Status Explanation
Title Check ✅ Passed The title clearly summarizes the primary change of correcting the error parsing for the sub error code and directly reflects the main modification in the PR without extraneous information.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch correctErrorParsing

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1cf49c3 and cb846c9.

📒 Files selected for processing (1)
  • app/src/org/commcare/connect/network/connectId/PersonalIdApiHandler.java (1 hunks)
🔇 Additional comments (1)
app/src/org/commcare/connect/network/connectId/PersonalIdApiHandler.java (1)

77-78: Approve error_sub_code usage
No remaining "sub_code" references detected. Confirm with the API documentation or backend that the field name is error_sub_code.


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 and usage tips.

@shubham1g5 shubham1g5 added this to the 2.60 milestone Oct 14, 2025
@shubham1g5 shubham1g5 added the skip-integration-tests Skip android tests. label Oct 14, 2025
@shubham1g5 shubham1g5 merged commit d945455 into commcare_2.60 Oct 15, 2025
1 of 2 checks passed
@shubham1g5 shubham1g5 deleted the correctErrorParsing branch October 15, 2025 04:34
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.

3 participants