Page MenuHomePhabricator

[lib] Reduce new PROCESS_DM_OPS action
ClosedPublic

Authored by ashoat on Jul 16 2024, 8:18 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Dec 23, 12:40 PM
Unknown Object (File)
Mon, Dec 23, 12:40 PM
Unknown Object (File)
Mon, Dec 23, 12:40 PM
Unknown Object (File)
Mon, Dec 23, 12:39 PM
Unknown Object (File)
Wed, Dec 4, 7:09 PM
Unknown Object (File)
Fri, Nov 29, 8:55 AM
Unknown Object (File)
Fri, Nov 29, 8:40 AM
Unknown Object (File)
Fri, Nov 29, 6:14 AM
Subscribers

Details

Summary

I compiled a list of reducers I should update by searching for existing reducers of PROCESS_MESSAGES and PROCESS_UPDATES. The former is only reduced in message-reducer.js, while the latter is reduced in all of the below reducers.

I excluded three reducers that currently reduce PROCESS_UPDATES:

  1. reduceKeyserverStore, which keeps track of updatesCurrentAsOf for keyserver updates. We're using a different mechanism to verify and track DM ops.
  2. reduceCurrentUserInfo, which should not be possible to affect with DM ops.
  3. reduceUserInfos, which should not be possible to affect with DM ops. The UserInfosHandler should handle populating the UserStore when new users are encountered via DM ops. Tracking this in a new task: ENG-8829.

Submitting this now so @tomek can see the code, as his work relates to this code.

Depends on D12780

Test Plan

Test plan described here

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

lib/reducers/message-reducer.js
1827 ↗(On Diff #42375)

By leaving truncationStatuses empty, we're saying that the truncation status should be UNCHANGED for all of the threads

lib/reducers/message-reducer.js
1827 ↗(On Diff #42375)

Note that this third parameter is for the rawMessageInfos, but the updateInfos can have their own RawMessageInfos with their own truncationStatuses (see D12828)

While we might want MessageTruncationStatuses other than UNCHANGED for the RawMessageInfos that come with the updateInfos, we'll always want UNCHANGED for the rawMessageInfos that aren't associated with updateInfos

This revision is now accepted and ready to land.Jul 22 2024, 1:57 AM
This revision was automatically updated to reflect the committed changes.