fix(contacts): hole in condition checking for unknown contact message#7517
Conversation
|
There was a problem hiding this comment.
Pull request overview
This PR tightens the “latest pending contact request” lookup logic so Accept/Dismiss can proceed even when persistence returns an empty contact request ID (e.g., due to the underlying message being missing), and adds regression tests for that edge case.
Changes:
- Treat an empty
contactRequestIDfrom persistence as “no pending request” and fall back todefaultContactRequestID(...). - Ensure the returned error is cleared when falling back to the default ID.
- Add tests covering accept/dismiss behavior when the contact request message is missing from persistence.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
protocol/messenger_contacts.go |
Updates latest-contact-request-ID retrieval to fall back to a default ID when persistence returns an empty ID. |
protocol/messenger_contact_requests_test.go |
Adds regression tests for accepting/dismissing when the contact request message has been deleted/missing. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Jenkins Builds
|
180fbb3 to
05501ff
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## release/10.34.x #7517 +/- ##
==================================================
Coverage ? 61.21%
==================================================
Files ? 851
Lines ? 119270
Branches ? 0
==================================================
Hits ? 73007
Misses ? 38768
Partials ? 7495
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Fixes status-im/status-app#21067
I had previously done a fix that addresses this issue: #7165
But turns out there was still a hole in the logic, because the persistence could return just an empty ID, so it would skip my bypass and just error later. Plus, I had forgotten to reset the error.
This fix addresses the hole and adds tests.
I wasn't able to actually test this e2e, because the bug is almost impossible to reproduce, since it requires paired devices and lost messages.