Closed igor-sirotin closed 2 weeks ago
Which branch are you using for this delivered
mark on messages? I have tried status-desktop develop
branch, but no this feature. @igor-sirotin
@kaichaosun sorry I didn't push it yet. I'll let you know when a PR is opened. But so far It seems to me that the it's the desktop side issue, because of the way we consider events from status-go.
Though resending the message is still weird, that is something you can check without my status-desktop changes.
I added a lock for Delivered
state on desktop side: https://github.com/status-im/status-desktop/pull/15450
But why do we receive the envelope.sent
event from status-go is still weird, this should be checked. Looks like it's being resent though it was delivered.
I'm able to reproduce it like this:
delivered
sent
again.sent
.NOTE: You'll need to remove those lines to see it in desktop UI: https://github.com/status-im/status-desktop/blob/db359c622a176fa28b63bf263cd6fad8210b107b/src/app/modules/shared_models/message_model.nim#L549-L550
cc @kaichaosun
Thanks @igor-sirotin, will look into the status-go code for the fix!
@igor-sirotin I'm not able to reproduce the scenario you pointed out (probably because I don't have fast connection and delivered is always comes later than sent), but do find one improvement, could you please check this change https://github.com/status-im/status-go/pull/5502 fix it?
Problem
For messages on status-desktop I see this outgoing status change flow:
sending
->delivered
->sent
https://github.com/status-im/status-go/assets/25482501/13519ee7-616f-4d52-b330-a262971914e8
After restart I can see it as
delivered
. And then it goes back tosent
again.From the logs it seems that this is happening due to message resending. MessageID from the video above:
0x158f207a2dd15b22a7ba3280494845245d192d02385c4c1799069a5ff7c18bba
:Implementation
We don't overwrite
delivered
in the db: https://github.com/status-im/status-go/blob/3b5eab3bf194e3d9f56fd98e1eb65b52f7683132/protocol/message_persistence.go#L2085-L2090But there's no condition on notifying the client: https://github.com/status-im/status-go/blob/47899fd0456826f8da79e5cdbe5bebe490742c88/protocol/messenger_peersyncing.go#L62
Acceptance Criteria
sending
->delivered
->sent
. No way back.delivered
orsent
state.