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)
Sat, Aug 31, 3:08 AM
Unknown Object (File)
Fri, Aug 30, 2:46 PM
Unknown Object (File)
Fri, Aug 30, 10:38 AM
Unknown Object (File)
Fri, Aug 30, 10:30 AM
Unknown Object (File)
Mon, Aug 26, 12:13 PM
Unknown Object (File)
Mon, Aug 26, 4:34 AM
Unknown Object (File)
Sun, Aug 25, 3:56 AM
Unknown Object (File)
Sun, Aug 18, 12:04 PM
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.