Page MenuHomePhabricator

[web] Fix user not getting logged out on ops failure
ClosedPublic

Authored by michal on Apr 5 2024, 2:59 AM.
Tags
None
Referenced Files
F1777995: D11563.diff
Fri, May 17, 6:32 AM
Unknown Object (File)
Thu, Apr 25, 12:22 AM
Unknown Object (File)
Apr 17 2024, 6:24 AM
Unknown Object (File)
Apr 17 2024, 4:06 AM
Unknown Object (File)
Apr 13 2024, 2:47 AM
Unknown Object (File)
Apr 11 2024, 2:38 AM
Unknown Object (File)
Apr 10 2024, 12:03 PM
Unknown Object (File)
Apr 10 2024, 9:07 AM
Subscribers

Details

Summary

ENG-7655 : User not getting logged out on web db ops failure

While working on D11544 I discovered that actually users weren't getting logged out on ops handling failure. Detailed explanation is in the linked task, but the general idea is that redux persist is able to persist data between calls to sharedWorker.init and location.reload and the db isn't cleared. This diff fixes it:

  • It introduces a new optional parameter markAsCorrupted which disallows any future operations on the db, until the webpage is reloaded
  • It also has to remove the localstorage fallback in comm-redux-storage-engine. Otherwise redux-persist persists data to localstorage which is then picked up in our old "localstorage to sqlite" migration, which also ends with user not getting logged out

Depends on D11544

Test Plan

Add a throw new Error in rekey message ops. Send a new message. Check that an alert shows up, the page is reloaded and after reload the user is logged out. Repeat a few times.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable