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
F6136925: D9245.diff
Tue, Apr 22, 5:50 AM
Unknown Object (File)
Thu, Apr 17, 12:42 PM
Unknown Object (File)
Thu, Apr 17, 11:07 AM
Unknown Object (File)
Thu, Apr 17, 9:04 AM
Unknown Object (File)
Thu, Apr 17, 2:47 AM
Unknown Object (File)
Thu, Apr 17, 12:01 AM
Unknown Object (File)
Wed, Apr 16, 5:59 AM
Unknown Object (File)
Mon, Apr 14, 11:18 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.