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

PEX.validateDefinition gives different results based on whether it is ran in Node.JS or React Native #118

Closed
TimoGlastra opened this issue Jun 16, 2023 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@TimoGlastra
Copy link
Contributor

  • I'm submitting a ...
    [x] bug report

  • Summary

Calling PEX.validateDefinition gives different results based on whether it is ran in Node.JS or React Native.

When calling validateDefinition on the following definition:

{
   "id":"022c2664-68cc-45cc-b291-789ce8b599eb",
   "purpose":"We want to know your name and e-mail address (will not be stored)",
   "input_descriptors":[
      {
         "id":"c2834d0e-3c95-4721-b21a-40e3d7ea2549",
         "name":"DBC Conference 2023 Attendee",
         "purpose":"To access this portal your DBC Conference 2023 attendance proof is required.",
         "schema":[
            {
               "uri":"DBCConferenceAttendee"
            }
         ],
         "constraints":{
            "fields":[
               {
                  "path":[
                     "$.credentialSubject.event.name",
                     "$.vc.credentialSubject.event.name"
                  ],
                  "filter":{
                     "type":"string",
                     "pattern":"DBC Conference 2023"
                  }
               }
            ]
         }
      }
   ]
}

The result in Node.JS (v18) for me is:

[ Checked { tag: 'root', status: 'info', message: 'ok' } ]

While in React Native I get:

[
   {
      "message":"presentation_definition should be as per json schema.",
      "status":"error",
      "tag":"root.presentation_definition"
   },
   {
      "message":"field object \"filter\" property must be valid json schema",
      "status":"error",
      "tag":"presentation_definition.input_descriptor[0].constraints.fields[0]"
   }
]

Not really an idea why this is happening. Bot environments are using 2.0.1 of PEX

  • Other information (e.g. detailed explanation, stack traces, related issues, suggestions how to fix, links for us to have context, eg. StackOverflow, personal fork, etc.)
@nklomp
Copy link
Contributor

nklomp commented Jun 28, 2023

@TimoGlastra Is this with the Hermes engine in RN?

This is a known issue to us and the reason why we switched to JCS. We should also be able to solve it, as we did that in the SIOP lib as well. @sksadjad will be picking this up shortly

@nklomp
Copy link
Contributor

nklomp commented Jun 30, 2023

I got from Slack that indeed it is Hermes.

@TimoGlastra Could you test with version 2.0.2-unstable.3, it should have fixed this issue (at least in our wallet). It also brings some more performance, as we moved AJV compilation to the build phase instead of doing it at runtime on the phone.

@nklomp
Copy link
Contributor

nklomp commented Jul 4, 2023

Please reopen in case it is not fixed. Should be resolved from version 2.0.3-unstable.3. A 2.1 will be release shortly

@nklomp nklomp closed this as completed Jul 4, 2023
@nklomp nklomp removed the in progress Work is being done label Jul 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants