fix(wallet): select first supported OID4VCI credential format to avoid unsupported issuance requests - #22
Merged
AlexanderShenshin merged 3 commits intoApr 6, 2026
Conversation
Signed-off-by: darshit2308 <darshit2308@gmail.com>
darshit2308
force-pushed
the
fix/oid4vc-credential-format-filtering
branch
from
April 3, 2026 10:28
909db54 to
95c106a
Compare
There was a problem hiding this comment.
Pull request overview
Fixes the OID4VCI issuance flow in the wallet by ensuring the requested credential configuration is selected based on a format the wallet supports, preventing runtime crashes when issuers list unsupported formats first.
Changes:
- Introduces a wallet-scoped allowlist of supported credential formats plus a helper to validate formats (including
undefined). - Updates credential selection to choose the first supported offered credential when no specific configuration ID is provided, and validates explicitly requested IDs for supported format.
- Adds tests covering mixed-format offers, explicit unsupported-format rejection, and all-unsupported rejection.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
heka-wallet/app/src/credentials/useOpenIdHandlers.ts |
Adds supported-format filtering/validation and improves failure behavior with more descriptive errors. |
heka-wallet/app/__tests__/credentials/useOpenIdHandlers.spec.ts |
Adds regression tests ensuring selection/validation behaves correctly with unsupported formats. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: darshit2308 <darshit2308@gmail.com>
darshit2308
force-pushed
the
fix/oid4vc-credential-format-filtering
branch
from
April 3, 2026 11:48
db2984c to
8c33943
Compare
AlexanderShenshin
self-requested a review
April 6, 2026 09:02
AlexanderShenshin
left a comment
Contributor
There was a problem hiding this comment.
Thanks for a contribution!
Looks great, I have couple of minor suggestions here.
Signed-off-by: darshit2308 <darshit2308@gmail.com>
darshit2308
force-pushed
the
fix/oid4vc-credential-format-filtering
branch
from
April 6, 2026 16:00
e6ea28b to
1c5b5e1
Compare
Contributor
Author
|
@AlexanderShenshin Sure, I have made the required changes . |
AlexanderShenshin
approved these changes
Apr 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description:
The wallet was not filtering offered credentials by supported format before requesting issuance.
If an issuer offered an unsupported format (e.g., AnonCreds or
jwt_vc) first in the credentialoffer list, the wallet would blindly attempt to request it and crash at runtime with an unhelpful
error, violating the OID4VCI specification's expectation that holders negotiate supported formats.
WALLET_SUPPORTED_CREDENTIAL_FORMATSconstant listing the four wallet-supported formats (vc+sd-jwt,jwt_vc_json,jwt_vc_json-ld,mso_mdoc)walletSupportsCredentialFormathelper that safely handlesundefinedformat valuesofferedCredentials[0]selection with.find()that filters by supported formatcredentialConfigurationIdToRequestis passed but resolves to an unsupported formatRelated issue(s):
No prior issue, this is a self-contained bug fix identified during code review of the OID4VCI
credential handling flow in
useOpenIdHandlers.ts.Notes for reviewer:
The core change is in
receiveCredentialFromOpenId4VciOfferinsideuseOpenIdHandlers.ts.Previously,
offeredCredentials[0]was used without any format check. Now:Checklist
useOpenIdHandlers.spec.tscovering: format-aware selection from mixed offers, explicit unsupported format rejection, and all-unsupported-formats rejection)