openwallet-foundation / credo-ts

Typescript framework for building decentralized identity and verifiable credential solutions
https://credo.js.org
Apache License 2.0
251 stars 188 forks source link

[React Native] Unable to use AnonCreds when Flipper is enabled in iOS #1778

Open genaris opened 4 months ago

genaris commented 4 months ago

After a good discussion in Discord with @valavanisleonidas, we found out that if we create a bare React Native project, the app crashes when attempting to use almost any AnonCreds feature. In anoncreds-rs JS wrapper we can see an EXC_BAD_ACCESS error while calling some functions that write into date passed by reference.

It seems that the issue happens only when Flipper is enabled, something that is set by default in recent React Native templates (up to 0.73.4). According to React Native RFC 0641, Flipper is already deprecated and will be removed from 0.74, so probably shouldn't a big deal. Also it seems that Expo is not encouraging its usage, which explains why it works properly there.

In case we cannot find a fix for this in anoncreds-rs, for the reasons explained aboe it might not a big deal. But we should warn users about this in docs and during agent initialization (if it's possible to detect it from JS code).

TimoGlastra commented 4 months ago

Great you found the issue! I think if flipper is deprecated we should just document this for now, I'll take it into account with writing the migration and shared components docs. Is it just for AnonCreds RS or are Indy VDR / Askar also susceptible?