Page MenuHomePhabricator

[lib] Create thread store ops from updates in a spec
ClosedPublic

Authored by tomek on Sep 20 2023, 5:23 AM.
Tags
None
Referenced Files
F3369898: D9245.diff
Mon, Nov 25, 11:58 PM
Unknown Object (File)
Fri, Nov 22, 4:48 PM
Unknown Object (File)
Thu, Nov 21, 3:06 PM
Unknown Object (File)
Wed, Nov 20, 8:06 PM
Unknown Object (File)
Wed, Nov 20, 1:46 AM
Unknown Object (File)
Thu, Nov 7, 5:52 PM
Unknown Object (File)
Tue, Nov 5, 3:17 AM
Unknown Object (File)
Fri, Nov 1, 5:26 AM
Subscribers

Details

Summary
Test Plan

Open two clients and check if making operations (e.g. updating or joining a thread) generates the right ops on the other.

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

tomek requested review of this revision.Sep 20 2023, 5:39 AM
kamil added inline comments.
lib/reducers/thread-reducer.js
70–80 ↗(On Diff #31310)

I think this can be simplified to return payload.updatesResult.newUpdates.map(update => ... ).filter(Boolean).flat();

lib/shared/updates/update-thread-read-status-spec.js
17–20 ↗(On Diff #31310)

nit: I think negation of this condition and early exit is more readable

This revision is now accepted and ready to land.Sep 25 2023, 2:20 AM

Add early return and use more functional approach

lib/reducers/thread-reducer.js
70–80 ↗(On Diff #31310)

Initially, I used a similar approach to what you propose, but Flow was complaining about it. Now I tried it again, and it seems to work.