-
Notifications
You must be signed in to change notification settings - Fork 249
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
[Local pairing] Application crash when pairing 3rd device #3667
Comments
1. Pairing desktop-1 → desktop-21.1. During the first pairing, device-2 receives
1.2. At this stage, there's no CR for this contact (it will try to sync it later) so a new CR record is created in 1.3. Because of status-go/protocol/messenger_handler.go Line 475 in 03f8237
1.4. Therefore, 1.5. We also receive some real contact request during syncing, but we don't save it, because there's such CR ID in the database. This looks suspicious to me, but anyway. So after the first sync we end up with 2. Pairing desktop-2 → desktop 32.1. Again, first the contact is synced, and we generate a fake CR for that contact, just as the first pairing. 2.2. Then device-3 syncs contact requests, and during that the generated CR is synced to device-3. status-go/protocol/messenger_contacts.go Line 290 in 03f8237
But there's no such contact with our public key. status-go/protocol/messenger_handler.go Lines 510 to 512 in 03f8237
Devices state
P.S. Another thing to mention, this "generated fake CR" has static |
Pushed a test that reproduces the bug: #3627 Removing unneccessary details from log, this is what you will see: 2023-06-30T14:32:23.930+0300 INFO pairing/sync_device_test.go:552 pairing Alice-1 and Alice-2
...
ERROR[06-30|14:32:25.210] failed to HandleSyncChatMessagesRead when HandleSyncRawMessages error="can't find chat"
WARN [06-30|14:32:25.210] syncContactRequestForInstallationContact: generated contact request contactRequest="clock:1688124745233 text:\"Please add me to your contacts\" chat_id:\"0x04c69081f6242463a34ba3c5d353d5dc4cc0c49fc0a57a2cc2827308c22648412f077eb9e210aff8fb0bb2ecb1a3c350c32065c6b79a44ed2e01cfaddb9acde867\" content_type:CONTACT_REQUEST "
ERROR[06-30|14:32:25.211] contact request not found contactRequestID=0xf8784917646693cfbda6f8e48569fe954cc00b59ca8d8f2d5c344de7f07e82cf error="record not found"
ERROR[06-30|14:32:25.211] failed to HandleSyncContactRequestDecision when HandleSyncRawMessages error="record not found"
...
2023-06-30T14:32:25.214+0300 INFO pairing/sync_device_test.go:560 pairing Alice-2 and Alice-3
...
INFO [06-30|14:32:26.167] syncContactRequestDecision from=0x04c69081f6242463a34ba3c5d353d5dc4cc0c49fc0a57a2cc2827308c22648412f077eb9e210aff8fb0bb2ecb1a3c350c32065c6b79a44ed2e01cfaddb9acde86720
WARN [06-30|14:32:26.168] syncContactRequestForInstallationContact: generated contact request contactRequest="clock:1688124746190 text:\"Please add me to your contacts\" chat_id:\"0x04c69081f6242463a34ba3c5d353d5dc4cc0c49fc0a57a2cc2827308c22648412f077eb9e210aff8fb0bb2ecb1a3c350c32065c6b79a44ed2e01cfaddb9acde867\" content_type:CONTACT_REQUEST "
ERROR[06-30|14:32:26.169] failed to update contact request: contact not found contact id=0x04b6891e5fa4a3302f52c42539c36af9eda8fe71a48e43d203bfc31a16bfb700d41f5b318e404d4922f2815d7e9f7223d8099365393fb3a656ff6f928f170cc4e0 I've added, but intentionally commented the status-go/protocol/messenger_contacts.go Lines 286 to 291 in 45d914c
So that leads to a crash:
|
Problem
The app crashes here during local pairing, because there's no
contactRequest.From
inm.allContacts
:status-go/protocol/messenger_contacts.go
Line 282 in 9c59634
At that point
contactRequest.From
is our public key.Steps to reproduce
Alice
[device-1]:Bob
Bob
:Alice
Alice
[device-2]:Alice
[device-3]:The text was updated successfully, but these errors were encountered: