Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@import overrides ResolvedContext LRU cache #537

Open
F-Node-Karlsruhe opened this issue Sep 12, 2023 · 0 comments
Open

@import overrides ResolvedContext LRU cache #537

F-Node-Karlsruhe opened this issue Sep 12, 2023 · 0 comments

Comments

@F-Node-Karlsruhe
Copy link

F-Node-Karlsruhe commented Sep 12, 2023

When using two different contexts both with imports the first context sets the cache with the following value as activeCtx, which appears to be a generic value. The other context then uses the (same) cache and fails, as it does not find the properties.

processedContext activeCtx key:
{"mappings":{},"inverse":null,"protected":{"id":true,"type":true,"VerifiableCredential":true,"VerifiablePresentation":true,"EcdsaSecp256k1Signature2019":true,"EcdsaSecp256r1Signature2019":true,"Ed25519Signature2018":true,"RsaSignature2018":true,"proof":true,"Ed25519VerificationKey2020":true,"Ed25519Signature2020":true},"processingMode":"json-ld-1.1","@version":1.1}

The code already warns that there can be cache issues with @import contexts https://github.com/digitalbazaar/jsonld.js/blob/main/lib/context.js#L386

If a processedImport is found it completely overrides the value instead of adding it to ctx https://github.com/digitalbazaar/jsonld.js/blob/main/lib/context.js#L364

Example of affected contexts:

  1. https://ssi.eecc.de/api/registry/context/productpassport
  2. https://ssi.eecc.de/api/registry/context/productpassport/powertool

Related issues:

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

No branches or pull requests

1 participant