Skip to content
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

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

saledjenic
Copy link
Contributor

Applying removed contact from the backup was removed due to condition.

@status-im-auto
Copy link
Member

status-im-auto commented Oct 7, 2024

Jenkins Builds

Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 8485653 #1 2024-10-07 15:34:54 ~3 min tests-rpc 📄log
✔️ 8485653 #1 2024-10-07 15:35:39 ~4 min linux 📦zip
✔️ 8485653 #1 2024-10-07 15:36:15 ~5 min android 📦aar
✔️ 8485653 #1 2024-10-07 16:04:51 ~33 min tests 📄log
✔️ cf3f847 #2 2024-10-07 19:37:44 ~2 min android 📦aar
✔️ cf3f847 #2 2024-10-07 19:38:16 ~2 min linux 📦zip
✔️ cf3f847 #2 2024-10-07 19:39:12 ~3 min tests-rpc 📄log
✔️ cf3f847 #2 2024-10-07 19:39:25 ~3 min ios 📦zip
✔️ cf3f847 #2 2024-10-07 20:08:44 ~33 min tests 📄log

Copy link

codecov bot commented Oct 7, 2024

Codecov Report

Attention: Patch coverage is 50.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 47.44%. Comparing base (ba37c32) to head (cf3f847).
Report is 5 commits behind head on develop.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
protocol/messenger_handler.go 50.00% 0 Missing and 1 partial ⚠️
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     
Flag Coverage Δ
functional 10.38% <0.00%> (+0.16%) ⬆️
unit 46.73% <50.00%> (-0.35%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
protocol/messenger_handler.go 59.33% <50.00%> (-0.21%) ⬇️

... and 80 files with indirect coverage changes

@@ -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
Copy link
Member

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

Copy link
Contributor Author

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.

@@ -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
Copy link
Member

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 🤔

Copy link
Contributor Author

@saledjenic saledjenic Oct 7, 2024

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:

  1. handleBackup (used when applying messages from the backup)
  2. HandleSyncRawMessages (used when local pairing)
  3. 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants