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(bridge)_: fix bridge replies not working when they come from Discord #5830

Merged
merged 2 commits into from
Sep 27, 2024

Conversation

jrainville
Copy link
Member

Fixes status-im/status-desktop#16323

The problem was that the code expected to receive the Discord message ID, but the bridge is smart enough to return the Status message ID already, so there is no need to try and convert it.

There were also a couple issues in the bridge code itself.

Bridge PR: status-im/matterbridge#18

@status-im-auto
Copy link
Member

status-im-auto commented Sep 12, 2024

Jenkins Builds

Click to see older builds (20)
Commit #️⃣ Finished (UTC) Duration Platform Result
✖️ 1c5288b #1 2024-09-12 22:06:46 ~1 min tests 📄log
✔️ 1c5288b #1 2024-09-12 22:07:45 ~2 min tests-rpc 📄log
✔️ 1c5288b #1 2024-09-12 22:09:23 ~3 min linux 📦zip
✔️ 1c5288b #1 2024-09-12 22:10:24 ~5 min ios 📦zip
✔️ 1c5288b #1 2024-09-12 22:10:52 ~5 min android 📦aar
✔️ d93e6a9 #2 2024-09-12 22:12:46 ~1 min android 📦aar
✔️ d93e6a9 #2 2024-09-12 22:12:54 ~2 min tests-rpc 📄log
✖️ d93e6a9 #2 2024-09-12 22:12:54 ~2 min tests 📄log
✔️ d93e6a9 #2 2024-09-12 22:14:00 ~3 min ios 📦zip
✔️ d93e6a9 #2 2024-09-12 22:14:07 ~3 min linux 📦zip
✔️ 2552a78 #3 2024-09-13 13:56:59 ~2 min android 📦aar
✔️ 2552a78 #3 2024-09-13 13:57:09 ~2 min linux 📦zip
✔️ 2552a78 #3 2024-09-13 13:57:10 ~2 min tests-rpc 📄log
✔️ 2552a78 #3 2024-09-13 13:58:43 ~3 min ios 📦zip
✖️ 2552a78 #3 2024-09-13 14:27:20 ~32 min tests 📄log
✔️ ba8236f #4 2024-09-23 17:09:27 ~2 min tests-rpc 📄log
✖️ ba8236f #4 2024-09-23 17:09:37 ~2 min tests 📄log
✔️ ba8236f #4 2024-09-23 17:10:26 ~3 min linux 📦zip
✔️ ba8236f #4 2024-09-23 17:11:22 ~4 min android 📦aar
✔️ ba8236f #4 2024-09-23 17:12:40 ~5 min ios 📦zip
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ c9023c0 #5 2024-09-24 18:17:42 ~2 min tests-rpc 📄log
✔️ c9023c0 #5 2024-09-24 18:18:55 ~4 min linux 📦zip
✔️ c9023c0 #5 2024-09-24 18:19:26 ~4 min ios 📦zip
✔️ c9023c0 #5 2024-09-24 18:19:50 ~4 min android 📦aar
✔️ c9023c0 #5 2024-09-24 18:46:35 ~31 min tests 📄log
✔️ 860e758 #6 2024-09-27 14:58:20 ~2 min android 📦aar
✔️ 860e758 #6 2024-09-27 14:58:52 ~2 min linux 📦zip
✔️ 860e758 #6 2024-09-27 14:59:01 ~2 min tests-rpc 📄log
✔️ 860e758 #6 2024-09-27 15:03:29 ~7 min ios 📦zip
✔️ 860e758 #6 2024-09-27 15:28:09 ~31 min tests 📄log

@jrainville jrainville changed the title fix(bridge): fix bridge replies not working when they come from Discord fix(bridge)_: fix bridge replies not working when they come from Discord Sep 12, 2024
@igor-sirotin
Copy link
Collaborator

igor-sirotin commented Sep 19, 2024

@jrainville a bunch of tests are failing, including TestBridgeMessageReplies 🤔
image

image

I think it's only TestBridgeMessageReplies and the others are just flaky.

Copy link
Collaborator

@igor-sirotin igor-sirotin left a comment

Choose a reason for hiding this comment

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

Nice and clean, just fix the TestBridgeMessageReplies

@jrainville
Copy link
Member Author

@igor-sirotin @osmaczko re-asking review because I removed even more code when I fixed the test.

I also tested again with the real app to make sure my assumptions were all right and it still all works. Proof:
image

Also, I tested closing the app and sending a lot of messages and replies, so that it would fetch out of order to confirm that it still managed to populate the replies even out of order and it worked:
image

For example, the 4 4 message came in, but not the 4 message, so at first it shower "unknown original message, please fetch", I did fetch more and 4 appeared and it populated the reply correctly 👍

@codecov-commenter
Copy link

codecov-commenter commented Sep 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 46.02%. Comparing base (d794e43) to head (c9023c0).

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #5830      +/-   ##
===========================================
+ Coverage    45.60%   46.02%   +0.42%     
===========================================
  Files          884      884              
  Lines       157168   157126      -42     
===========================================
+ Hits         71674    72325     +651     
+ Misses       77245    76503     -742     
- Partials      8249     8298      +49     
Flag Coverage Δ
functional 11.57% <0.00%> (?)
unit 45.60% <100.00%> (+<0.01%) ⬆️

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

Files with missing lines Coverage Δ
protocol/message_persistence.go 71.91% <100.00%> (+0.12%) ⬆️

... and 86 files with indirect coverage changes

@@ -1995,18 +1995,18 @@ func TestBridgeMessageReplies(t *testing.T) {
err = insertMinimalBridgeMessage(p, "444", "4", "3")
require.NoError(t, err)

// status message "222" should have reply_to = "111"
// status message "222" should have reply_to =" 1" because it's a discord message to another discord message
Copy link
Collaborator

Choose a reason for hiding this comment

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

These message ids are so unobvious, impossible to read the test really 😵‍💫

Fixes status-im/status-desktop#16323

The problem was that the code expected to receive the Discord message ID, but the bridge is smart enough to return the Status message ID already, so there is no need to try and convert it.

There were also a couple issues in the bridge code itself.
@jrainville jrainville merged commit 2bbcce6 into develop Sep 27, 2024
12 checks passed
@jrainville jrainville deleted the fix/bridge-replies branch September 27, 2024 15:36
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.

Bridge replies don't show as replies from Status to Discord
6 participants