Skip to content

Comments

Credential offer can be resolved multiple times simultaneously#966

Merged
erbenjak merged 11 commits intorelease/openid4vcfrom
bug/duplicate-requests-on-the-same-credential-offer-url
Feb 23, 2026
Merged

Credential offer can be resolved multiple times simultaneously#966
erbenjak merged 11 commits intorelease/openid4vcfrom
bug/duplicate-requests-on-the-same-credential-offer-url

Conversation

@erbenjak
Copy link

Readiness checklist

  • I added/updated tests.
  • I ensured that the PR title is good enough for the changelog.
  • I labeled the PR.
  • I self-reviewed the PR.

@erbenjak erbenjak added the bug Something isn't working label Feb 19, 2026
@erbenjak erbenjak requested a review from Copilot February 19, 2026 06:45
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR implements an in-memory cache for credential offer requests to prevent duplicate API calls when the same credential offer URL appears multiple times in a single request expansion. The cache stores Promises to ensure concurrent calls for the same URL share the same underlying request, addressing a race condition in the existing persistent cache implementation.

Changes:

  • Added an in-memory Promise-based cache (credentialOfferCache) to the DataViewExpander class
  • Modified credential offer request handling to check the cache before making new requests
  • Wrapped the API call in error handling that returns undefined on failure

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Member

@Milena-Czierlinski Milena-Czierlinski left a comment

Choose a reason for hiding this comment

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

Please update the branch to the base branch. Also, the title of the PR should be adjusted, such that it doesn't have a prefix (we use labels for this) and that it describes the bug instead of the solution.

@erbenjak erbenjak changed the title Fix: Create a request cache to ensure that each credential is only fetched once Credential offer can be resolved multiple times simultaneously Feb 20, 2026
@erbenjak erbenjak merged commit 1b86030 into release/openid4vc Feb 23, 2026
32 of 35 checks passed
@erbenjak erbenjak deleted the bug/duplicate-requests-on-the-same-credential-offer-url branch February 23, 2026 08:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants