HomePhabricator
Diffusion Comm 5c5f6fd7fcea

[server] Replace setJoinsToUnread with setNewMembersToUnread parameter to…

Description

[server] Replace setJoinsToUnread with setNewMembersToUnread parameter to changeRole

Summary:
The old setJoinsToUnread function was pretty hacky. It mutated MembershipRows before creation, and got called on more rows than it needed to. It didn't matter since unread status only affects thread members, but it certainly doesn't hurt to be more selective in which memberships rows we set to unread.

Note that we only need to set new members to unread when they are added to a thread, but we never want to set the viewer to unread. So we include it for initial members and adding members, but skip it for the viewer joining or creating a thread.

Test Plan:
I tested the three scenarios that this diff affects:

  • createThread
  • updateThread (adding users)
  • joinThread

Reviewers: palys-swm

Reviewed By: palys-swm

Subscribers: KatPo, Adrian, atul

Differential Revision: https://phabricator.ashoat.com/D1027

Details

Provenance
ashoatAuthored on Apr 19 2021, 1:40 PM
Reviewer
tomek
Differential Revision
Restricted Differential Revision
Parents
rCOMM9f3bac32a703: [server] Make sure we update parentThreadID in updateRole before updating…
Branches
Unknown
Tags
Unknown