inside my datastore configuration:
afterSerialization: async (data) => {
const payload = await data;
console.log('E1: ', payload);
const encrypted = await encryptData(payload);
console.log('E2: ', encrypted);
return encrypted;
},
beforeDeserialization: async (data) => {
const payload = await data;
console.log('D1: ', payload);
const decrypted = await decryptData(payload);
console.log('D2: ', decrypted);
return decrypted;
},
gives me:
Error: beforeDeserialization is not the reverse of afterSerialization, cautiously refusing to start NeDB to prevent dataloss
E1: W
E2: FuoRfmMKynBFuOOLrEBhSw==
D1: FuoRfmMKynBFuOOLrEBhSw==
D2: W
it appears that the encryption/decryption will not work if they are asynchronous functions, it would be good to support this because all the good AES crypto libraries on react-native are asynchronous.