Skip to content

fix(contacts): hole in condition checking for unknown contact message#7517

Merged
jrainville merged 1 commit into
release/10.34.xfrom
fix/missing-contact-request-message
Jun 4, 2026
Merged

fix(contacts): hole in condition checking for unknown contact message#7517
jrainville merged 1 commit into
release/10.34.xfrom
fix/missing-contact-request-message

Conversation

@jrainville

Copy link
Copy Markdown
Member

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.

@github-actions

github-actions Bot commented Jun 3, 2026

Copy link
Copy Markdown

⚠️ Companion PR Required

Add a link to your status-app PR in this PR's description.

Example: https://github.com/status-im/status-app/pull/123

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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 contactRequestID from persistence as “no pending request” and fall back to defaultContactRequestID(...).
  • 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.

Comment thread protocol/messenger_contacts.go Outdated
@status-im-auto

status-im-auto commented Jun 3, 2026

Copy link
Copy Markdown
Member

Jenkins Builds

Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 180fbb3 1 2026-06-03 18:23:23 ~3 min linux/status-go 📦zip
✔️ 180fbb3 1 2026-06-03 18:23:44 ~4 min macos/status-go 📦zip
✔️ 180fbb3 1 2026-06-03 18:27:36 ~7 min windows/status-go 📦zip
✔️ 180fbb3 1 2026-06-03 18:34:23 ~14 min tests-rpc 📄log
✔️ 180fbb3 1 2026-06-03 18:53:32 ~33 min tests 📄log
✔️ 05501ff 2 2026-06-03 18:31:23 ~4 min linux/status-go 📦zip
✔️ 05501ff 2 2026-06-03 18:31:42 ~4 min macos/status-go 📦zip
✔️ 05501ff 2 2026-06-03 18:35:51 ~7 min windows/status-go 📦zip
✔️ 05501ff 2 2026-06-03 18:49:12 ~14 min tests-rpc 📄log
✔️ 05501ff 2 2026-06-03 19:28:03 ~34 min tests 📄log

@jrainville
jrainville force-pushed the fix/missing-contact-request-message branch from 180fbb3 to 05501ff Compare June 3, 2026 18:27
@jrainville
jrainville requested a review from Copilot June 3, 2026 18:27

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

@codecov

codecov Bot commented Jun 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (release/10.34.x@7db3f14). Learn more about missing BASE report.

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           
Flag Coverage Δ
functional 40.15% <0.00%> (?)
unit 55.23% <100.00%> (?)

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

Files with missing lines Coverage Δ
protocol/messenger_contacts.go 59.37% <100.00%> (ø)

@jrainville
jrainville merged commit 9aa8e50 into release/10.34.x Jun 4, 2026
16 of 19 checks passed
@jrainville
jrainville deleted the fix/missing-contact-request-message branch June 4, 2026 14:49
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.

Incorrect Pending Contact Request

4 participants