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
F2911683: D9048.diff
Mon, Oct 7, 12:23 AM
Unknown Object (File)
Fri, Sep 27, 1:16 PM
Unknown Object (File)
Fri, Sep 27, 1:16 PM
Unknown Object (File)
Fri, Sep 27, 1:15 PM
Unknown Object (File)
Fri, Sep 27, 1:01 PM
Unknown Object (File)
Sat, Sep 14, 12:41 PM
Unknown Object (File)
Aug 29 2024, 3:19 AM
Unknown Object (File)
Aug 27 2024, 4:29 AM
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
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

lib/selectors/socket-selectors.js
125–129 ↗(On Diff #30655)

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 ↗(On Diff #30655)

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 ↗(On Diff #30655)
This revision is now accepted and ready to land.Sep 4 2023, 5:09 AM
lib/selectors/socket-selectors.js
114 ↗(On Diff #30655)

Flow isn't that smart

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