Page MenuHomePhabricator

[web] use default `updatesCurrentAsOf` in transform if value is missing
ClosedPublic

Authored by kamil on Nov 28 2023, 7:37 AM.
Tags
None
Referenced Files
F3351845: D10069.diff
Sat, Nov 23, 3:49 AM
Unknown Object (File)
Wed, Nov 6, 6:51 AM
Unknown Object (File)
Oct 17 2024, 12:08 PM
Unknown Object (File)
Oct 17 2024, 12:08 PM
Unknown Object (File)
Oct 17 2024, 12:07 PM
Unknown Object (File)
Oct 17 2024, 12:07 PM
Unknown Object (File)
Oct 4 2024, 7:31 PM
Unknown Object (File)
Oct 4 2024, 7:23 PM
Subscribers

Details

Summary

This is just an enhancement, I tested and this not cause any issues, but I prefer to add this for consistency.

In D9948 persistence to this field was enabled, but on the first rehydration this value could be undefined.

Alternative solution is adding migration, not sure what is better here.

Test Plan
  1. Reverting D9948
  2. Use web app
  3. Revert commit reverting D9948
  4. Check if updatesCurrentAsOf is not rehydrated as undefined.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

kamil held this revision as a draft.
kamil published this revision for review.Nov 28 2023, 8:02 AM

on the first rehydration this value could be undefined

Is it also true for other values from the keyserverInfo? Should we also handle them somehow?

This revision is now accepted and ready to land.Nov 29 2023, 12:43 AM

I'd do this using a migration, but I guess this is fine. It might be just confusing for someone reading this code in the future.
It's not a problem for other fields because since D9062 no other fields were started to be persisted. And the possibility of updatesCurrentAsOf being undefined here comes from the fact that it was not persisted, and then the user opens the app and the value doesn't exist in the persisted state, and we weren't adding it in any way.
And if a user migrates from state where the whole keyserverStore was not persisted to the current state, they get a default keyserverStore from the default redux state