Page MenuHomePhabricator

[web] Check backup version when restoring
ClosedPublic

Authored by tomek on May 8 2024, 9:55 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Nov 10, 11:42 AM
Unknown Object (File)
Sun, Nov 10, 4:49 AM
Unknown Object (File)
Fri, Nov 8, 3:41 PM
Unknown Object (File)
Fri, Nov 8, 4:41 AM
Unknown Object (File)
Fri, Nov 8, 4:36 AM
Unknown Object (File)
Fri, Nov 8, 3:33 AM
Unknown Object (File)
Fri, Nov 8, 3:27 AM
Unknown Object (File)
Fri, Nov 8, 3:24 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
Lint
Lint Not Applicable
Unit
Tests Not Applicable

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.May 8 2024, 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.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.