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)
Thu, Dec 19, 12:31 PM
Unknown Object (File)
Thu, Dec 19, 12:31 PM
Unknown Object (File)
Thu, Dec 19, 12:31 PM
Unknown Object (File)
Thu, Dec 19, 12:31 PM
Unknown Object (File)
Thu, Dec 19, 12:31 PM
Unknown Object (File)
Thu, Dec 19, 12:29 PM
Unknown Object (File)
Fri, Dec 13, 1:37 PM
Unknown Object (File)
Thu, Dec 5, 2:26 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