Signal-iOS/SignalMessaging
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
..
attachments Prevent non-temporary-file attachments from being deleted when shared 2022-06-22 13:15:04 -07:00
calls Ignore peek call errors in staging 2022-06-29 14:32:19 -05:00
categories Merge branch igor/media-editor-updates. 2022-07-06 14:54:26 -07:00
contacts Remove unnecessary NotificationCenter.removeObserver calls 2022-08-02 17:43:52 -07:00
Donations Improve validation for incoming gift messages 2022-07-26 09:28:48 -07:00
environment Ignore checkpointing errors on launch 2022-06-24 22:27:01 -05:00
groups Prevent empty group updates from clobbering that a member joined via invite link 2022-08-03 15:04:31 -05:00
Notifications DRY out GroupUpdateCopy construction 2022-07-18 15:03:21 -07:00
Payments Fix SwiftLint is_disjoint violations 2022-05-25 14:17:10 +00:00
profiles Remove unnecessary NotificationCenter.removeObserver calls 2022-08-02 17:43:52 -07:00
Storage Service PR Feedback 2022-07-15 15:05:03 -07:00
Subscriptions Improve logging for donations 2022-08-02 18:19:40 -05:00
test Fix SwiftLint shorthand_operator violations 2022-06-07 14:51:57 +00:00
utils Remove unnecessary NotificationCenter.removeObserver calls 2022-08-02 17:43:52 -07:00
Info.plist Shared framework between app and extension 2017-11-29 13:58:27 -08:00
SignalMessaging-Prefix.pch minor changes due to changed name of NSLocalizedStringFromAppBundle (now OWSLocalizedString) and new location of swift function and preprocessor definition 2022-03-11 14:08:26 +01:00
SignalMessaging.h Copy in AFNetworking's query string encoding implementation 2021-12-17 14:52:59 -08:00