Page MenuHomePhabricator

[web] Fix connection field missing
ClosedPublic

Authored by inka on Dec 22 2023, 5:01 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Nov 27, 9:13 AM
Unknown Object (File)
Sat, Nov 23, 4:24 PM
Unknown Object (File)
Thu, Oct 31, 1:23 AM
Unknown Object (File)
Oct 16 2024, 2:09 AM
Unknown Object (File)
Oct 16 2024, 2:09 AM
Unknown Object (File)
Oct 16 2024, 2:09 AM
Unknown Object (File)
Oct 16 2024, 2:09 AM
Unknown Object (File)
Oct 16 2024, 2:09 AM
Subscribers

Details

Summary

issue: ENG-6104
See this discussion for all details, but here are the most important things:

  1. migrateStorageToSQLite can be called on current and later version of the app, because the db might not be available sometimes and then we default to using local storage.
  2. a transform changing is also a problem in the usual case - we persist state with one transform and then restore it with a changed one - this will cause issues. So if we ever change the transforms, they should be responsible themselves for making sure that the old persisted state isn't broken (this is in reference to the comment I deleted).
  3. This diff doesn't change the behaviour when oldStorage?._persist?.version === 4
Test Plan

tested that the connection filed is no longer missing in the following scenario:

  1. login
  2. kill the keyserver
  3. logout
  4. refresh (app not working)
  5. run keyserver
  6. refresh -> connection is missing

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Harbormaster returned this revision to the author for changes because remote builds failed.Dec 22 2023, 5:27 AM
Harbormaster failed remote builds in B25315: Diff 34969!
inka requested review of this revision.Dec 22 2023, 5:35 AM
  1. Could we apply all transforms in persistConfig.transforms dynamically instead of "hardcoding" them in migrateStorageToSQLite?

a transform changing is also a problem in the usual case - we persist state with one transform and then restore it with a changed one - this will cause issues. So if we ever change the transforms, they should be responsible themselves for making sure that the old persisted state isn't broken (this is in reference to the comment I deleted).

In that case should we move the oldStorage?._persist?.version >= 4 condition inside of the keyserverStoreTransform? If someone adds a new transform then it would have it's own condition inside it, from which state version it should modify the state data?

Iterate all transforms
The if was removed altogether, because this particular transform is always correct

I'm not as familiar with the redux-persist transforms code as @michal, but since this is resolving an urgent issue and @michal is out of office, I'll go ahead and accept it on his behalf.

@inka, might also be good to set a reminder to ping @michal about this diff to confirm that there are no issues after he's back.

This revision is now accepted and ready to land.Dec 27 2023, 6:21 AM

@inka, might also be good to set a reminder to ping @michal about this diff to confirm that there are no issues after he's back.

I will do that

This revision was automatically updated to reflect the committed changes.