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(backup)_: dont generate a CR if the synced contact is mutual #6184

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

Conversation

jrainville
Copy link
Member

@jrainville jrainville commented Dec 9, 2024

Fixes status-im/status-desktop#15849

The problem was that we generated a "fake" contact request for all synced contacts. While it's true that even mutual contacts have a contact request, we don't need it anymore once mutual and since we don't sync messages, we had to generate it with a default message and that message looked very out of place after a recovery.

Mutual contact:
image

Contact that sent us a CR (not sure why the image and name don't show:
image

Contact to whom we sent a CR:
image

Now, the CR messages at least make sense

@status-im-auto
Copy link
Member

status-im-auto commented Dec 9, 2024

Jenkins Builds

Click to see older builds (16)
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 814e375 #1 2024-12-09 20:59:12 ~4 min macos 📦zip
✔️ 814e375 #1 2024-12-09 20:59:14 ~4 min ios 📦zip
✔️ 814e375 #1 2024-12-09 21:00:06 ~5 min linux 📦zip
✔️ 814e375 #1 2024-12-09 21:00:17 ~5 min android 📦aar
✔️ 814e375 #1 2024-12-09 21:00:35 ~5 min windows 📦zip
✔️ 814e375 #1 2024-12-09 21:01:48 ~7 min tests-rpc 📄log
✔️ 814e375 #1 2024-12-09 21:03:08 ~8 min macos 📦zip
✖️ 814e375 #1 2024-12-09 21:25:43 ~30 min tests 📄log
✔️ 029ea03 #2 2024-12-09 21:37:04 ~4 min windows 📦zip
✔️ 029ea03 #2 2024-12-09 21:37:19 ~4 min ios 📦zip
✔️ 029ea03 #2 2024-12-09 21:37:22 ~4 min macos 📦zip
✔️ 029ea03 #2 2024-12-09 21:38:12 ~5 min linux 📦zip
✔️ 029ea03 #2 2024-12-09 21:38:21 ~5 min android 📦aar
✔️ 029ea03 #2 2024-12-09 21:39:10 ~6 min tests-rpc 📄log
✔️ 029ea03 #2 2024-12-09 21:41:34 ~8 min macos 📦zip
✖️ 029ea03 #2 2024-12-09 22:04:01 ~31 min tests 📄log
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 4187ae9 #3 2024-12-12 19:59:29 ~4 min linux 📦zip
✔️ 4187ae9 #3 2024-12-12 19:59:32 ~4 min macos 📦zip
✔️ 4187ae9 #3 2024-12-12 19:59:43 ~4 min ios 📦zip
✔️ 4187ae9 #3 2024-12-12 20:00:51 ~5 min android 📦aar
✔️ 4187ae9 #3 2024-12-12 20:01:03 ~5 min windows 📦zip
✔️ 4187ae9 #3 2024-12-12 20:03:14 ~8 min macos 📦zip
✔️ 4187ae9 #3 2024-12-12 20:06:48 ~11 min tests-rpc 📄log
✖️ 4187ae9 #3 2024-12-12 20:29:12 ~34 min tests 📄log
✔️ a417efe #4 2024-12-13 20:14:54 ~4 min windows 📦zip
✔️ a417efe #4 2024-12-13 20:15:02 ~4 min macos 📦zip
✔️ a417efe #4 2024-12-13 20:15:11 ~4 min ios 📦zip
✔️ a417efe #4 2024-12-13 20:15:39 ~5 min linux 📦zip
✔️ a417efe #4 2024-12-13 20:15:56 ~5 min android 📦aar
✔️ a417efe #4 2024-12-13 20:16:32 ~6 min tests-rpc 📄log
✔️ a417efe #4 2024-12-13 20:19:42 ~9 min macos 📦zip
✖️ a417efe #4 2024-12-13 20:39:55 ~29 min tests 📄log
✖️ a417efe #5 2024-12-13 21:15:00 ~30 min tests 📄log
✔️ a417efe #6 2024-12-13 22:44:53 ~29 min tests 📄log

@jrainville jrainville force-pushed the fix/restoring-contacts-weird-messages branch from 814e375 to 029ea03 Compare December 9, 2024 21:32
@@ -601,6 +601,7 @@ func (m *Messenger) generateContactRequest(clock uint64, timestamp uint64, conta
contactRequest := common.NewMessage()
contactRequest.ChatId = contact.ID
contactRequest.WhisperTimestamp = timestamp
contactRequest.Timestamp = timestamp
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without this, the message showed as being sent in 1970

@jrainville jrainville force-pushed the fix/restoring-contacts-weird-messages branch from 029ea03 to 4187ae9 Compare December 12, 2024 19:54
@jrainville
Copy link
Member Author

@osmaczko @igor-sirotin friendly reminder to review

Copy link
Contributor

@osmaczko osmaczko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TestPairAcceptContactRequest is failing, can you please take a look?

Fixes status-im/status-desktop#15849

The problem was that we generated a "fake" contact request for all synced contacts.
While it's true that even mutual contacts have a contact request, we don't need it anymore once mutual and since we don't sync messages, we had to generate it with a default message and that message looked very out of place after a recovery.
@jrainville jrainville force-pushed the fix/restoring-contacts-weird-messages branch from 4187ae9 to a417efe Compare December 13, 2024 20:10
Copy link

codecov bot commented Dec 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 61.21%. Comparing base (74db631) to head (a417efe).
Report is 1 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #6184      +/-   ##
===========================================
- Coverage    61.27%   61.21%   -0.06%     
===========================================
  Files          833      833              
  Lines       109910   109913       +3     
===========================================
- Hits         67348    67287      -61     
- Misses       34711    34750      +39     
- Partials      7851     7876      +25     
Flag Coverage Δ
functional 19.31% <33.33%> (-0.03%) ⬇️
unit 60.03% <100.00%> (-0.05%) ⬇️

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

Files with missing lines Coverage Δ
protocol/messenger_contacts.go 61.18% <100.00%> (+0.17%) ⬆️
protocol/messenger_handler.go 59.62% <100.00%> (+0.03%) ⬆️

... and 35 files with indirect coverage changes

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.

Strange private chat content after restoring from seed phrase
3 participants