-
Notifications
You must be signed in to change notification settings - Fork 245
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix_: applying removed contacts from backup #5925
base: develop
Are you sure you want to change the base?
Conversation
Jenkins Builds
|
Codecov ReportAttention: Patch coverage is
✅ All tests successful. No failed tests found.
Additional details and impacted files@@ Coverage Diff @@
## develop #5925 +/- ##
===========================================
- Coverage 47.79% 47.44% -0.36%
===========================================
Files 834 833 -1
Lines 137749 137793 +44
===========================================
- Hits 65843 65370 -473
- Misses 64308 64638 +330
- Partials 7598 7785 +187
Flags with carried forward coverage won't be shown. Click here to find out more.
|
protocol/messenger_handler.go
Outdated
@@ -583,6 +583,8 @@ func (m *Messenger) handleSyncChats(messageState *ReceivedMessageState, chats [] | |||
func (m *Messenger) HandleSyncInstallationContactV2(state *ReceivedMessageState, message *protobuf.SyncInstallationContactV2, statusMessage *v1protocol.StatusMessage) error { | |||
// Ignore own contact installation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment is no longer on the right line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, was testing something else and that left. Removed now.
protocol/messenger_handler.go
Outdated
@@ -583,6 +583,8 @@ func (m *Messenger) handleSyncChats(messageState *ReceivedMessageState, chats [] | |||
func (m *Messenger) HandleSyncInstallationContactV2(state *ReceivedMessageState, message *protobuf.SyncInstallationContactV2, statusMessage *v1protocol.StatusMessage) error { | |||
// Ignore own contact installation | |||
|
|||
fromBackup := statusMessage == nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not clear why having no message means it comes from backups 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, there are 3 places where this function is called from:
handleBackup
(used when applying messages from the backup)HandleSyncRawMessages
(used when local pairing)dispatchToHandler
->handleSyncInstallationContactV2Protobuf
(used when a synced message comes from another (paired) device over the network)
In case of point 3 the code is the same as it was, in case of points 1 and 2 we need to store the contact even it has Removed
or Blocked
flag set to false
.
That's why I used this flag fromPairedDevice := statusMessage != nil
to filter out the source from which messages are coming.
So the issue was spotted in status-im/status-mobile#18096 but based on the code the same happens for Removed or Blocked contacts for applying messages from backup and local pairing. That should be fixed now.
8485653
to
cf3f847
Compare
Applying removed contact from the backup was removed due to condition.