This diff modifies native rust code to attach backup message to upload request provided the file exists.
Details
For now test that backup upload works for password users. Very next diff will enable testing for SIWE users with just one button click
Diff Detail
- Repository
- rCOMM Comm
- Lint
No Lint Coverage - Unit
No Test Coverage
Event Timeline
native/backup/use-client-backup.js | ||
---|---|---|
54 | is there a way to make it nullable to avoid mocking with an empty string? |
native/backup/use-client-backup.js | ||
---|---|---|
54 | Actually this is a bit problematic. We can change the types so that user passes undefined or null instead of empty string. However the user MUST explicitly pass undefined or null - otherwise JSI will crash. Unfortunately if we change the type in CommCoreModuleJSISchema.js to sth like this: +createNewBackup: ( backupSecret: string, siweBackupMsg: ?string, ) => Promise<void>; Flow won't complain if the user doesn't undefined explicitly so it won't prevent potential crash. Therefore it is best to create new JSI specifically for siwe backup creation. P.S. JSI crashes since it accesses arguments by accessing array. So if the user doesn't provide anything for backup message JSI will try to access out of array bounds. |
- Rename msg_backup to siwe_backup_msg
- Introcuce separate backup creation JSI calls for SIWE and password users to avoid macking empty string or potential crashes if dev forgets to specify null