Skip to content

Fix: Create a request cache to ensure that each credential is only fetched once#966

Open
erbenjak wants to merge 10 commits intorelease/openid4vcfrom
bug/duplicate-requests-on-the-same-credential-offer-url
Open

Fix: Create a request cache to ensure that each credential is only fetched once#966
erbenjak wants to merge 10 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.

@erbenjak erbenjak requested a review from britsta February 19, 2026 13:39
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.

1 participant

Comments