Skip to content

added logger to debug the sendotp response#199

Merged
anushasunkada merged 1 commit intomosip:developfrom
nandhu-kumar:develop-local1
Mar 27, 2026
Merged

added logger to debug the sendotp response#199
anushasunkada merged 1 commit intomosip:developfrom
nandhu-kumar:develop-local1

Conversation

@nandhu-kumar
Copy link
Copy Markdown

@nandhu-kumar nandhu-kumar commented Mar 27, 2026

Summary by CodeRabbit

  • Chores
    • Enhanced logging for OTP response handling to improve system observability and debugging capabilities during authentication operations.

Signed-off-by: Nandhukumar <nandhukumare@gmail.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 27, 2026

Walkthrough

The sendOTP() method in HelperService now includes two additional logging statements to output the inner OTP response—once in JSON format and once as a raw object. These logs are placed before the return statement without affecting control flow or returned values.

Changes

Cohort / File(s) Summary
Logging Enhancement
mosip-identity-plugin/src/main/java/io/mosip/esignet/plugin/mosipid/service/HelperService.java
Added two logging statements in sendOTP() to output the inner OTP response in both JSON-serialized and raw object formats for improved observability.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🐰 Hops 'round the logs with delight,
Two new lines bringing visibility to night,
JSON and raw, both shine so bright,
Debugging made easier—what a sight!
Hop, hop, hop—the code's just right! 🌙

🚥 Pre-merge checks | ✅ 2 | ❌ 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%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'added logger to debug the sendotp response' accurately describes the main change: adding logging statements to debug the sendOTP response in HelperService.sendOTP().

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@mosip-identity-plugin/src/main/java/io/mosip/esignet/plugin/mosipid/service/HelperService.java`:
- Around line 159-160: The current info-level logs in HelperService (the
log.info lines referencing
objectMapper.writeValueAsString(idaSendOtpResponse.getResponse()) and
idaSendOtpResponse.getResponse()) expose masked contact metadata and call
objectMapper.writeValueAsString which can throw after the OTP side-effect;
change these to a guarded debug-only log (wrap with log.isDebugEnabled()) that
logs only non-sensitive derived fields (e.g., boolean flags like hasMaskedEmail,
hasMaskedMobile or String masks returned by getMaskedEmail/getMaskedMobile) and
remove the direct objectMapper.writeValueAsString call (or wrap it in try/catch
and swallow exceptions) so JSON processing errors cannot alter the method
outcome after the OTP was sent.
🪄 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: 0c190fc4-3992-404b-8e05-db13b737fae5

📥 Commits

Reviewing files that changed from the base of the PR and between d0246c0 and a155125.

📒 Files selected for processing (1)
  • mosip-identity-plugin/src/main/java/io/mosip/esignet/plugin/mosipid/service/HelperService.java

@anushasunkada anushasunkada merged commit 02be020 into mosip:develop Mar 27, 2026
13 checks passed
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