HomePhabricator
Diffusion Comm 5704f7fa8d34

[web] Initialize database at startup on safari

Description

[web] Initialize database at startup on safari

Summary:
Part of ENG-4844
Fixed ENG-4878
Depends on D9107

On safari we need to start database before rehydration like on other browsers. This is done by initializing the database in getDatabaseModule, so as soon as it's called somewhere we make sure the database is ready to go. This diff also merges initForDBForLoggedInUser, init, and constructor because there was some code duplication.

Test Plan:
Test in safari and in chromium:

  • check if there's "Database initialization success" when logging in and when reloading when logged in
  • check if clearSensitiveData is called after logging out
  • check if draft are still there after reload (drafts are persisted with db operations)
  • check if selected apps are still there after reload (selected apps are persisted with standard redux persist mechanism)

Reviewers: kamil, atul, inka, tomek, ashoat

Reviewed By: kamil, ashoat

Subscribers: ashoat

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

Details

Provenance
Michal Gniadek <michal.gniadek@swmansion.com>Authored on Sep 8 2023, 3:03 AM
Reviewer
kamil
Differential Revision
D9108: [web] Initialize database at startup on safari
Parents
rCOMM254a9328e508: [web] Move safari db key init to database module
Branches
Unknown
Tags
Unknown

Event Timeline