Page MenuHomePhabricator

[lib] Exclusively use "ops approach" in `reduceThreadUpdates`
ClosedPublic

Authored by atul on Jun 2 2022, 3:37 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Nov 23, 10:25 PM
Unknown Object (File)
Sat, Nov 23, 7:44 PM
Unknown Object (File)
Sat, Nov 23, 6:03 PM
Unknown Object (File)
Thu, Nov 7, 10:37 PM
Unknown Object (File)
Sat, Nov 2, 3:14 PM
Unknown Object (File)
Oct 25 2024, 7:29 PM
Unknown Object (File)
Oct 25 2024, 2:30 AM
Unknown Object (File)
Oct 21 2024, 6:39 AM

Details

Summary

reduceThreadUpdates used to return both an updated threadStore object and corresponding threadStoreOperations. reduceThreadUpdates has a single callsite and that's in reduceThreadStore where only the threadStoreOperations property of the returned object was being pulled out anyways... so in this diff we remove the updated object to clean things up.

(Since this function is no longer really a "reducer," we'll rename this to something like generateOpsForThreadUpdates)


Depends on D4196

Test Plan

assertThreadStoreThreadsAreEqual hasn't flagged anything since it's been included in staff builds so we can assume "the ops are good."

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

atul requested review of this revision.Jun 2 2022, 3:44 PM
tomek added inline comments.
lib/reducers/thread-reducer.js
132–135 ↗(On Diff #13312)

We should be able to always return threadOperations, right? If !someThreadUpdated it would be simply [].

This revision is now accepted and ready to land.Jun 3 2022, 2:57 AM

cherrypick before addressing feedback