Skip to content

refactor: update OVP Error message#2512

Merged
swatigoel merged 1 commit into
inji:developfrom
tw-mosip:update-err-message
Jul 1, 2026
Merged

refactor: update OVP Error message#2512
swatigoel merged 1 commit into
inji:developfrom
tw-mosip:update-err-message

Conversation

@KiruthikaJeyashankar

@KiruthikaJeyashankar KiruthikaJeyashankar commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

Changes include

  1. Non-2xx response from the verifier after presentation submission - modify error title and message
  2. Pre-registered verifier not in the wallet's trusted list - modify error title and message
  3. Client name not available in the VP request + No matching credentials -> show unknown verifier

  1. Client name not available in the VP request + No matching credentials

If the client_name is unavailable we can display "Unknown Verifier"

  1. Non-2xx response from the verifier after presentation submission

User message: Verification couldn't be completed.
Description: The verifier encountered an error while processing your presentation. Please try again later.
We should avoid exposing HTTP status codes or backend errors in the UI. Those can be logged for debugging.

  1. Pre-registered verifier not in the wallet's trusted list

User message: Untrusted verifier.
Description: This verifier isn't in your wallet's trusted list. Your information has not been shared.

Issue ticket number and link

#2513

Screenshots

OVP Flow - Verifier with no client name

No Matching credentials error screen
Screenshot 2026-07-01 at 4 17 34 PM

Requested cards screen
Screenshot 2026-07-01 at 4 22 57 PM

Verifier Trust Modal
image

OVP Flow - Verifier responding with non 2xx status code on VP response submission

image

OVP Flow - Pre-registered verifier not in the wallet's trusted list

image

Summary by CodeRabbit

  • New Features

    • Added localized messaging for unknown or untrusted verifiers in the verification flow.
    • Improved scan screen guidance with clearer Bluetooth, QR, and scanning prompts.
  • Bug Fixes

    • Updated error screens to show clearer messages when verification can’t be completed.
    • Removed empty verifier-name fallbacks so the app now uses localized labels for unknown verifiers.
  • Localization

    • Refreshed translations across multiple languages for scan, trust, and verification error states.

@coderabbitai

coderabbitai Bot commented Jul 1, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

This PR replaces the localized "unknown verifier" text fallback with a translation-key-based fallback (verifierInfo.unknownVerifier), refactors SendVPError's props to remove verifierInfo in favor of separate name/logo props, adds an early invalid_client handling branch in the error modal hook, removes the setTrustedVerifiersApiCallError action while adding error-cause logging, adjusts screen/controller wiring, and updates locale strings across six languages.

Changes

Unknown verifier flow

Layer / File(s) Summary
Verifier name fallback selector
machines/openID4VP/openID4VPSelectors.ts, machines/openID4VP/openID4VPSelectors.test.ts
selectVerifierNameInTrustModal returns a localized verifierInfo.unknownVerifier fallback via i18n instead of undefined when client metadata is missing; tests updated accordingly.
Error modal invalid_client handling
shared/hooks/useOvpErrorModal.ts, shared/hooks/useOvpErrorModal.test.ts
Adds an early invalid_client branch showing errors.unknownVerifier title/message and logging VERIFIER_AUTHENTICATION_FAILED; minor formatting adjustments elsewhere.
Action error logging and removed action
machines/openID4VP/openID4VPActions.ts, machines/openID4VP/openID4VPActions.test.ts
Removes setTrustedVerifiersApiCallError action and tests; adds event.data.cause to console error logging in setSignVPError/setSendVPShareError.
SendVPError prop contract change
components/openid4vp/SendVPError.tsx
Drops verifierInfo prop/type; builds verifierInfo inline from verifierNameInTrustModal/verifierLogoInTrustModal.
SendVPScreen and controller wiring
screens/openid4vp/SendVPScreen.tsx, screens/openid4vp/SendVPScreenController.ts, screens/Scan/ScanLayout.tsx
Removes text fallback for unknown verifier names in UI, derives selectedVcs via getSelectedVcs, and reformats controller import/handler code without behavior change.
Locale updates for unknownVerifier and error messages
locales/ara.json, locales/en.json, locales/fil.json, locales/hin.json, locales/kan.json, locales/tam.json
Updates ScanScreen/invalidQR strings, adds errors.unknownVerifier objects, updates verifierResponseError copy, adds verifierInfo.unknownVerifier labels.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related issues

Suggested reviewers: swatigoel

Poem

A hop, a skip, a verifier unknown,
No longer nameless, no fallback alone,
With i18n keys we hop through the code,
Trust modals lit up along the road,
🐇 Carrots for clean errors, logged with care! 🥕

🚥 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%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title matches the PR's main OVP error-message update and is concise enough.
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.
Description check ✅ Passed The PR description covers the changes and includes screenshots, but the issue ticket link is still a placeholder.
✨ 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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
locales/tam.json (1)

879-880: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

invalidQR string is in Kannada, not Tamil.

The value "ದಯವಿಟ್ಟು ಮಾನ್ಯವಾದ QR ಅನ್ನು ಸ್ಕ್ಯಾನ್ ಮಾಡಿ" is Kannada script (identical to locales/kan.json line 892), not translated Tamil text. Tamil users will see the wrong language for this scan-error message.

🌐 Proposed fix
-    "invalidQR": "ದಯವಿಟ್ಟು ಮಾನ್ಯವಾದ QR ಅನ್ನು ಸ್ಕ್ಯಾನ್ ಮಾಡಿ",
+    "invalidQR": "தயவுசெய்து சரியான QR ஐ ஸ்கேன் செய்யவும்",
🤖 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 `@locales/tam.json` around lines 879 - 880, The invalidQR translation in
locales/tam.json is using Kannada text instead of Tamil, so replace that value
with the proper Tamil scan-error message. Update the invalidQR entry in the
Tamil locale file to match the language used by scanningGuide and keep the key
unchanged so the localization lookup still works.
🤖 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 `@screens/openid4vp/SendVPScreenController.ts`:
- Around line 51-61: Drop the unused imports from SendVPScreenController so the
block lint-cleanly compiles; specifically remove getMosipLogo from the VCUtils
import, remove Credential and VerifiableCredentialData from the VCMetaMachine/vc
import, and remove VCMetadata, while keeping the symbols that are still
referenced such as getFaceAttribute, VC, and isDcqlFlow.

In `@shared/hooks/useOvpErrorModal.ts`:
- Around line 2-6: The import list in useOvpErrorModal includes MatchResult, but
that symbol is unused and causes lint failure. Remove MatchResult from the
destructured import from openid4vp.types and keep the remaining referenced types
(such as MatchingVcsResult and VerifierInfo) unchanged.
- Around line 73-81: The `useOvpErrorModal` error handling is shadowing the
later QR-code `invalid_client` branch, so the unknown-verifier modal wins first.
Adjust the `error.includes('invalid_client')` condition in `useOvpErrorModal` to
distinguish the verifier-authentication case from the QR-code fallback (for
example by checking a more specific source or pattern) so the later
invalid-QR-code path can still run. Keep the fix localized to the matching logic
around the existing
`generateAndStoreLogMessage('VERIFIER_AUTHENTICATION_FAILED')` branch.

---

Outside diff comments:
In `@locales/tam.json`:
- Around line 879-880: The invalidQR translation in locales/tam.json is using
Kannada text instead of Tamil, so replace that value with the proper Tamil
scan-error message. Update the invalidQR entry in the Tamil locale file to match
the language used by scanningGuide and keep the key unchanged so the
localization lookup still works.
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 743b7422-f4df-42d7-ba21-a81a04a0c1ab

📥 Commits

Reviewing files that changed from the base of the PR and between 1b140ef and fb68c58.

📒 Files selected for processing (16)
  • components/openid4vp/SendVPError.tsx
  • locales/ara.json
  • locales/en.json
  • locales/fil.json
  • locales/hin.json
  • locales/kan.json
  • locales/tam.json
  • machines/openID4VP/openID4VPActions.test.ts
  • machines/openID4VP/openID4VPActions.ts
  • machines/openID4VP/openID4VPSelectors.test.ts
  • machines/openID4VP/openID4VPSelectors.ts
  • screens/Scan/ScanLayout.tsx
  • screens/openid4vp/SendVPScreen.tsx
  • screens/openid4vp/SendVPScreenController.ts
  • shared/hooks/useOvpErrorModal.test.ts
  • shared/hooks/useOvpErrorModal.ts
💤 Files with no reviewable changes (1)
  • machines/openID4VP/openID4VPActions.test.ts

Comment thread screens/openid4vp/SendVPScreenController.ts Outdated
Comment thread shared/hooks/useOvpErrorModal.ts Outdated
Comment thread shared/hooks/useOvpErrorModal.ts
Changes include
1. Non-2xx response from the verifier after presentation submission - modify error title and message
2. Pre-registered verifier not in the wallet's trusted list - modify error title and message
3. Client name not available in the VP request + No matching credentials -> show unknown verifier

Signed-off-by: KiruthikaJeyashankar <kiruthikavjshankar@gmail.com>
@swatigoel swatigoel merged commit 9de5163 into inji:develop Jul 1, 2026
24 of 26 checks passed
@KiruthikaJeyashankar KiruthikaJeyashankar linked an issue Jul 2, 2026 that may be closed by this pull request
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.

[Wallet] [OpenID4VP] update OVP flow Error message

3 participants