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
F3151839: D9245.diff
Tue, Nov 5, 3:17 AM
Unknown Object (File)
Fri, Nov 1, 5:26 AM
Unknown Object (File)
Fri, Nov 1, 3:47 AM
Unknown Object (File)
Wed, Oct 9, 10:01 PM
Unknown Object (File)
Oct 2 2024, 11:52 AM
Unknown Object (File)
Oct 2 2024, 11:52 AM
Unknown Object (File)
Oct 2 2024, 11:52 AM
Unknown Object (File)
Oct 2 2024, 11:48 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.