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

W3cCredentialService Custom Document Loader does not work when no Internet -> e2e Tests Fail #1111

Closed
NB-MikeRichardson opened this issue Nov 21, 2022 · 0 comments · Fixed by #1119
Assignees

Comments

@NB-MikeRichardson
Copy link
Contributor

NB-MikeRichardson commented Nov 21, 2022

If I run the w3cCredentialService tests (in modules/vc/tests/W3cCredentialService.test.ts) with my internet connection turned off most of the tests fail (with the invalid URL error that you get when it cannot resolve an external uri).

See the custom document loader in packages/core/src/modules/vc/tests/documentLoader.ts

The custom loader has a call to jsonld.frame for did: URLs :-

if (url.startsWith('did:')) {
  result = await jsonld.frame(result, {
    '@context': result['@context'],
    '@embed': '@never',
    id: url,
  })
}

Inside the jsonld.frame call (deep inside the digitalcredentials library) it is attempting to resolve the context by attempting to go across the internet (which fails)

It looks like it uses its own default document loader to do this (which I believe relies on having a network connection)

@NB-MikeRichardson NB-MikeRichardson changed the title W3cCredentialService Custom Document Loader does not work when no Internet W3cCredentialService Custom Document Loader does not work when no Internet -> e2e Tests Fail Nov 21, 2022
@karimStekelenburg karimStekelenburg self-assigned this Nov 24, 2022
TimoGlastra pushed a commit that referenced this issue Dec 12, 2022
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

Successfully merging a pull request may close this issue.

2 participants