digitalcredentials / learner-credential-wallet

Learner Credential Wallet is a cross-platform iOS and Android mobile application for storing and sharing digital learner credentials.
https://lcw.app
MIT License
57 stars 29 forks source link

Update to latest jsonld, http-client, webcrypto. #553

Closed dmitrizagidulin closed 8 months ago

dmitrizagidulin commented 8 months ago

Note that this is a PR to Vojtech's feat/add-expo RN upgrade branch.

dmitrizagidulin commented 8 months ago

@vonovak As part of testing the RN upgrade PR, I added a unit test to verify a VC. But running it in jest gives a segmentation fault. Can you take a look and see if there's something I'm missing?

To reproduce, run install, then run test:

$ npm t
> learner-credential-wallet@1.0.0 test
> jest

RUNS  test/verify.test.ts
Segmentation fault (core dumped)
dmitrizagidulin commented 8 months ago

@vonovak Oh interesting, checking the lint CI job (which, btw, we need to separate into lint and test jobs), the error seems to be:

          error: Error: Could not load "StatusList2021Credential"; reason: NotFoundError loading "https://digitalcredentials.github.io/credential-status-playground/JWZM3H8WKU": A dynamic import callback was invoked without --experimental-vm-modules
              at _checkStatus (/home/runner/work/learner-credential-wallet/learner-credential-wallet/node_modules/@digitalcredentials/vc-status-list/dist/index.js:190:17)

Will investigate what this dynamic import is..

dmitrizagidulin commented 8 months ago

@vonovak ok, more info on the segfault. The dynamic import callback error is the result of the http-client library interacting with Jest. It was supposed to be partially addressed by PR https://github.com/digitalbazaar/http-client/pull/35 and issue https://github.com/digitalbazaar/http-client/issues/34 (see discussion / notes there). I'm not entirely sure what to do here, since running NODE_OPTIONS=--experimental-vm-modules npx jest still causes the segfault. (See also the discussion at https://github.com/jestjs/jest/issues/9430 )

dmitrizagidulin commented 8 months ago

Thanks again to @vonovak; merging this PR into the feat/add-expo branch / PR #550