Page MenuHomePhabricator

[lib] Move calendar filters update reducer into specs
ClosedPublic

Authored by tomek on Sep 28 2023, 7:38 AM.
Tags
None
Referenced Files
F3520466: D9315.id31609.diff
Mon, Dec 23, 12:26 AM
F3518531: D9315.diff
Sun, Dec 22, 8:12 PM
Unknown Object (File)
Mon, Dec 16, 8:03 PM
Unknown Object (File)
Mon, Dec 16, 8:03 PM
Unknown Object (File)
Mon, Dec 16, 8:03 PM
Unknown Object (File)
Fri, Dec 13, 9:52 PM
Unknown Object (File)
Nov 20 2024, 10:59 PM
Unknown Object (File)
Nov 20 2024, 7:34 AM
Subscribers

Details

Summary

Changed a solution slightly. Instead of mutating a set for each update, we're creating a new one, which might be less performant, but is better for maintainability.

Depends on D9296

https://linear.app/comm/issue/ENG-4241/handle-processupdatesactiontype-as-a-part-of-a-spec

Test Plan

Bring back the old code and check if it produces the same result while handling delete, join, or update thread update.

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

tomek requested review of this revision.Sep 28 2023, 7:56 AM
kamil added inline comments.
lib/reducers/calendar-filters-reducer.js
142–146

Maybe we can make this logic here more consistent with other reduce from previous diffs, but don't have a strong opinion on that.

149

This also makes sense in a way it is, but just want to make sure, is the operator !== intentional and better than _isEqual in this case?

This revision is now accepted and ready to land.Sep 29 2023, 3:55 AM

Make the approach more consistent

lib/reducers/calendar-filters-reducer.js
142–146

Makes sense!

149

Each of the reducers returns the original object if the update doesn't change it, so it makes sense to check just the references. The result should be the same, but the current approach is less wasteful.

lib/reducers/calendar-filters-reducer.js
149

thanks for confirmation