Signal-iOS/SignalMessaging/groups
Sasha Weiss 7cf14333ad
Prevent empty group updates from clobbering that a member joined via invite link
Group snapshots fetched from the service do not store the
`didJoinFromInviteLink` field on their members, and when we parse a
snapshot into a group model we hardcode this value to `false` for all
members. However, we store that field locally on a `GroupMembership`'s
`MemberStateMap` when processing an "add members" change action, as the
field is provided in the `AddMember` change action proto.

This becomes an issue, since when we refresh the group's state from the
service (which we do periodically, e.g. when opening a group for the
first time after launch) the `GroupMembership` from the group's snapshot
on the service will not match the `GroupMembership` we have locally,
even though they are from the same revision, due to mismatched
`didJoinFromInviteLink` values (hardcoded in the snapshot).
Consequently, we believed we were "updating the group model in a user-
facing way", but the only change therein was clobbering a
`didJoinFromInviteLink: true` to `...: false`, which was 1) wrong and
2) did not have a description to show.

This commit changes `GroupMembership` to ignore values for
`didJoinFromInviteLink` when comparing equality. This means that when we
parse a snapshot into a `TSGroupModel` with all those values hardcoded
to false, but otherwise identical to our local, we will no longer see it
as different from our local (and subsequently clobber our local and
generate an empty update).
2022-08-03 15:04:31 -05:00
..
GroupsV2AvatarDownloadOperation.swift Convert to new Promise library 2021-09-03 11:41:34 -07:00
GroupsV2Impl.swift Remove correct request-denied-because-banned error from behind a feature flag 2022-07-18 11:18:35 -07:00
GroupsV2Impl+RestoreGroups.swift Clean up HTTP error metadata accessors. 2021-10-15 11:52:31 -03:00
GroupsV2IncomingChanges.swift Ban and unban users as part of add/remove/deny group actions 2022-07-15 09:41:19 -07:00
GroupsV2Migration.swift Don't need transactions to build group models 2022-07-12 10:23:12 -07:00
GroupsV2OutgoingChangesImpl.swift Allow outgoing changes with only ban actions 2022-07-18 15:03:33 -07:00
GroupsV2ProfileKeyUpdater.swift Fix violations of SwiftLint's attributes rule 2022-05-14 09:07:42 -05:00
GroupsV2Protos.swift Ban and unban users as part of add/remove/deny group actions 2022-07-15 09:41:19 -07:00
GroupsV2Utils.swift Add OWSIdentityManager.shouldSharePhoneNumber(with:transaction:) 2022-05-19 14:20:53 -07:00
GroupV2Params.swift Update to LibSignalClient v0.15.0 2022-03-24 11:55:45 -07:00
GroupV2SnapshotImpl.swift Update to LibSignalClient v0.15.0 2022-03-24 11:55:45 -07:00
GroupV2UpdatesImpl.swift Prevent empty group updates from clobbering that a member joined via invite link 2022-08-03 15:04:31 -05:00
StorageService+GroupsV2.swift Update to LibSignalClient v0.15.0 2022-03-24 11:55:45 -07:00