@import overrides ResolvedContext LRU cache
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:
- https://ssi.eecc.de/api/registry/context/productpassport
- https://ssi.eecc.de/api/registry/context/productpassport/powertool
Related issues:
- https://github.com/digitalbazaar/jsonld.js/issues/502
- https://github.com/digitalbazaar/jsonld.js/issues/500