Page MenuHomePhabricator

[web] Check backup version when restoring
ClosedPublic

Authored by tomek on May 8 2024, 9:55 AM.
Tags
None
Referenced Files
F3180314: D11947.diff
Fri, Nov 8, 4:41 AM
F3180287: D11947.id40948.diff
Fri, Nov 8, 4:36 AM
F3179774: D11947.id39940.diff
Fri, Nov 8, 3:33 AM
F3179685: D11947.id40930.diff
Fri, Nov 8, 3:27 AM
F3179667: D11947.id40881.diff
Fri, Nov 8, 3:24 AM
F3178510: D11947.id.diff
Fri, Nov 8, 2:04 AM
F3178446: D11947.id40378.diff
Fri, Nov 8, 1:48 AM
F3178240: D11947.diff
Fri, Nov 8, 1:19 AM
Subscribers

Details

Summary

If a backup is from newer version that the client, we can't restore it and the client needs to be updated in order to restore the backup.

version2.png (1×1 px, 124 KB)

https://linear.app/comm/issue/ENG-7008/detect-that-the-compaction-is-from-a-newer-version-than-the-app-and

Depends on D12013

Test Plan

Created a backup on native and tried to restore it on web, where the native version was greater that the web version. Verified that an exception was thrown during the restoration.

Diff Detail

Repository
rCOMM Comm
Branch
transactions
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

web/redux/persist.js
526

We can't import the config in the worker and we have to create a new const instead.

tomek requested review of this revision.May 8 2024, 10:12 AM
web/redux/persist.js
526

Is there really no way to have a single place with this constant? I'm confused what the challenge is

526

Oops, ignore me – I literally commented on the line where you're deduping the constant 😅

Should we display some kind of a message to the user?

Accepting, because this diff is only about detecting the case when a backup version is incompatible - looks like handling of this error or implementing a different approach will be handled after finalizing the discussion from ENG-7008

This revision is now accepted and ready to land.May 14 2024, 11:22 PM
In D11947#341896, @inka wrote:

Should we display some kind of a message to the user?

Currently, restoring the backup happens only from the dev menu where a message from an exception is displayed. In the future, handling this exception should be a part of the login flow.

restore.png (1×1 px, 110 KB)

In the future, handling this exception should be a part of the login flow.

I wonder if there is a way to document this on Linear

In the future, handling this exception should be a part of the login flow.

I wonder if there is a way to document this on Linear

I've created https://linear.app/comm/issue/ENG-8133/verify-backup-version-after-fetching-it-on-login to track.

This revision was automatically updated to reflect the committed changes.