-
Notifications
You must be signed in to change notification settings - Fork 195
-
Notifications
You must be signed in to change notification settings - Fork 195
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
Comments
This was referenced Sep 12, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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:
Related issues:
The text was updated successfully, but these errors were encountered: