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 2, 3:14 PM
Unknown Object (File)
Fri, Oct 25, 7:29 PM
Unknown Object (File)
Fri, Oct 25, 2:30 AM
Unknown Object (File)
Mon, Oct 21, 6:39 AM
Unknown Object (File)
Fri, Oct 18, 7:17 PM
Unknown Object (File)
Wed, Oct 9, 10:15 AM
Unknown Object (File)
Oct 8 2024, 8:56 AM
Unknown Object (File)
Oct 8 2024, 8:55 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