HomePhabricator
Diffusion Comm d35aa5447d1a

Introduce fallback mechanism for notifications decryption if MMKV…

Description

Introduce fallback mechanism for notifications decryption if MMKV initialization hasn't been executed yet.

Summary:
This differential fixes: https://linear.app/comm/issue/ENG-7309/nse-received-c-exception-nse-cant-initialize-mmkv-encryption-key. If decryption with session
stored in MMKV failes (since MMKV wasn't initialized yet) we try to use previous file-based session.

Test Plan:

  1. Revert this diff and the diff that migrates notifs session to MMKV. For the second reosolve the conflicts by making migration 38 a no-op.
  2. Build the app and log in. This puts the app in legacy notifications state - notifications session is created in a flat file.
  3. Reset reveerts, build the app again and send notifications.
  4. Ensure notifications are working since the fallback mechanism uses old session.
  5. Log out and log in again. Ensure that notifs are still working - new approach is working as well.

Reviewers: tomek, bartek, kamil

Reviewed By: kamil

Subscribers: ashoat

Differential Revision: https://phab.comm.dev/D11541