Skip to content

Handle empty presentation matches without crashing#437

Closed
nodh wants to merge 1 commit intodevelopmentfrom
fix/436-empty-presentation-matches-dev
Closed

Handle empty presentation matches without crashing#437
nodh wants to merge 1 commit intodevelopmentfrom
fix/436-empty-presentation-matches-dev

Conversation

@nodh
Copy link
Copy Markdown
Member

@nodh nodh commented Mar 20, 2026

Summary

  • reject Presentation Exchange descriptors that have no matching stored credential before the selection UI is built
  • guard related selection and presentation-result code paths that assumed non-empty collections
  • add a regression test for the empty-match Presentation Exchange case

Verification

  • ./gradlew :shared:testAndroidHostTest --tests ui.presentation.CredentialSelectionProviderTest

Fixes #436

@nodh nodh self-assigned this Mar 20, 2026
@nodh nodh requested a review from gp-iaik March 20, 2026 11:17
@nodh
Copy link
Copy Markdown
Member Author

nodh commented Mar 20, 2026

iOS Build is fixed in #434

@nodh
Copy link
Copy Markdown
Member Author

nodh commented Mar 20, 2026

Closed in favor of #438

@nodh nodh closed this Mar 20, 2026
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f32f9d33a8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +25 to +26
if (it is PresentationExchangeMatchingResult) {
validatePresentationExchangeInputDescriptorMatches(it.matchingResult.inputDescriptorMatches)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Route empty PE matches through the no-credential state

When an OpenID4VP/DCAPI Presentation Exchange request has at least one descriptor with no local match, this check now throws during toCredentialSelectionProvider(). In the graph-based flows (DefaultPresentationGraphViewModel/DCAPIPresentationGraphViewModel), that exception is converted to UiStateError, and PresentationGraphView immediately forwards it to onError, which WalletNavigation handles by popping back to HomeScreenRoute. The result is that a normal “no matching credential” case is now surfaced as a fatal error instead of the existing no-match UX used in AuthenticationViewModel.onConsent, so users lose the explanatory screen and are bounced out of the flow.

Useful? React with 👍 / 👎.

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.

1 participant