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
F2193178: D9245.id31607.diff
Thu, Jul 4, 9:20 PM
F2193084: D9245.id31776.diff
Thu, Jul 4, 9:05 PM
F2192921: D9245.id31310.diff
Thu, Jul 4, 8:42 PM
F2191922: D9245.id31310.diff
Thu, Jul 4, 6:13 PM
F2190891: D9245.diff
Thu, Jul 4, 12:58 PM
Unknown Object (File)
Tue, Jul 2, 7:50 PM
Unknown Object (File)
Tue, Jul 2, 4:59 PM
Unknown Object (File)
Fri, Jun 21, 9:50 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

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

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

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.