Page MenuHomePhabricator

[lib] Use specs to determine hash value for inner infos
ClosedPublic

Authored by tomek on Aug 31 2023, 7:23 AM.
Tags
None
Referenced Files
F3517758: D9048.diff
Sun, Dec 22, 6:10 PM
Unknown Object (File)
Wed, Dec 4, 8:31 PM
Unknown Object (File)
Nov 10 2024, 3:59 PM
Unknown Object (File)
Nov 10 2024, 3:59 PM
Unknown Object (File)
Nov 10 2024, 3:58 PM
Unknown Object (File)
Nov 5 2024, 2:12 AM
Unknown Object (File)
Oct 18 2024, 2:10 PM
Unknown Object (File)
Oct 7 2024, 8:30 PM
Subscribers

Details

Summary

Choose the right spec and based on that an info and compute a hash for it.

https://linear.app/comm/issue/ENG-4813/migrate-getclientresponsesselector-to-a-spec

Depends on D9031

Test Plan

Modify server state and check if state check fixes client state.

Diff Detail

Repository
rCOMM Comm
Branch
state-sync
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

lib/selectors/socket-selectors.js
125–129

Entry info handling was a bit different than the other ones, but it didn't have to - the difference was that we were converting to serverEntryInfo, but this conversion was done earlier (now in stateSyncSpecs.entries.convertClientToServerInfos). The second conversion (here) was redundant and can be safely omitted.

lib/selectors/socket-selectors.js
125–127

A condition where innerSpec isn't present corresponds to the else clause in the original code - we're keeping the same behavior by continuing the loop (it is important because it lets us introduce new state syncs without breaking older clients).

tomek requested review of this revision.Aug 31 2023, 7:41 AM
kamil added inline comments.
lib/selectors/socket-selectors.js
114
This revision is now accepted and ready to land.Sep 4 2023, 5:09 AM
lib/selectors/socket-selectors.js
114

Flow isn't that smart

Cannot get spec.innerHashSpec.hashKey because property hashKey is missing in undefined