This differential implements a method in NotificationsCryptoModule that can deserialize flat file containing JSON-fied pickled olm account into in-memory CryptoModule onject that is capable to perform end2end encrypted messaging sessions.
Details
Temporarily make this method public. Partially modify this method so that it does not read from a file but takes JSONI-ified pickled olm account directly and use it to create CryptoModule instance in CommCoreModule where we read pickled public olm account from the database. Use XCode debugger or logging to examine object
content. JSON-ified pickled olm account can be created in CommCoreModule.
Diff Detail
- Repository
- rCOMM Comm
- Lint
No Lint Coverage - Unit
No Test Coverage
Event Timeline
native/cpp/CommonCpp/Notifications/BackgroundDataStorage/NotificationsCryptoModule.cpp | ||
---|---|---|
46 ↗ | (On Diff #22879) |
That said if serializeAndFlushCryptoModule fails on the very first write (first after last deletion of this file) to olm notifications account path, we will fail on the fist if in deserializeCryptoModule (the file does not exist). If it failed on n-th write, we will read correct content after last successful write to this file. So I think we can add this if statement and throw, but my understanding is that it is not necessary. |
We definitely should return something from this lambda since otherwise it is useless to assign it to variable.
If we find that we don't have permissions then just calling await this.requestAndroidNotificationsPermission(); would result in a prompt asking for notifications permissions. However if the user grants those permissions then hasPermissions is still falsy (since promise returned nothing), so deviceToken will be set to null. Nevertheless permissions are actually granted byt the OS, so the state on the device and keyserver would heal itself on next render.
This differential fixes this case so that if user grants permissions correct state is achieved immediately without need for additional re-render to heal the state.