Page MenuHomePhabricator

[web] Check backup version when restoring
AcceptedPublic

Authored by tomek on Wed, May 8, 9:55 AM.
Tags
None
Referenced Files
F1799090: version2.png
Mon, May 20, 3:10 AM
Unknown Object (File)
Sun, May 19, 12:07 AM
Unknown Object (File)
Sat, May 18, 8:06 AM
Unknown Object (File)
Thu, May 16, 1:23 AM
F1768593: restore.png
Wed, May 15, 7:55 AM
Unknown Object (File)
Mon, May 13, 8:20 PM
Unknown Object (File)
Sun, May 12, 7:58 AM
Unknown Object (File)
Fri, May 10, 4:22 AM
Subscribers

Details

Reviewers
kamil
marcin
inka
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 D11942

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
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

web/redux/persist.js
526 ↗(On Diff #39940)

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

tomek requested review of this revision.Wed, May 8, 10:12 AM
web/redux/persist.js
526 ↗(On Diff #39940)

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

526 ↗(On Diff #39940)

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.Tue, May 14, 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.