Skip to content

feat!: fire MsgRead on subsequent MDNs#7979

Open
WofWca wants to merge 1 commit intomainfrom
wofwca/94a1253b1e
Open

feat!: fire MsgRead on subsequent MDNs#7979
WofWca wants to merge 1 commit intomainfrom
wofwca/94a1253b1e

Conversation

@WofWca
Copy link
Collaborator

@WofWca WofWca commented Mar 12, 2026

BREAKING CHANGE: previously this event only fired
if message state really did just transition
from DC_STATE_OUT_DELIVERED to DC_STATE_OUT_MDN_RCVD.
Now this is only the case for MsgRead events
that have the newly added first_time == true.

Closes deltachat/deltachat-desktop#5220.

This is also useful for channels
as it facilitates updating the post (message) read count live.

Despite the fact that it's a breaking change,
this should not be problematic in most cases
because clients mostly use this event as an "it's time to reload"
indicator.

There is a case in Delta Chat Desktop where and adjustment
will be needed:
https://github.com/deltachat/deltachat-desktop/blob/d1fbb309793934b3ca09ed5a0266b6c84e333dd0/packages/frontend/src/stores/messagelist.ts#L119-L123
It seems that the message state could later transition
to DC_STATE_OUT_FAILED, so we should not uncoditionally set it
to DC_STATE_OUT_MDN_RCVD.

On Android I have also searched for the usages of this event,
and it seems that, without adjustments on Android side,
this would only cause excessive reloading:

It might also fix what seems to be a bug with "seen recently",
which on release Core doesn't get updated if the message
is already read:
https://github.com/deltachat/deltachat-android/blob/1894425ad2726fd21dde5275f5b137e6f3fb1499/src/main/java/org/thoughtcrime/securesms/ConversationActivity.java#L1672-L1676

TODO:

  • Check whether iOS client is fine with this change
  • Double-check if Android client is fine with this change
  • Note that this does not expose first_time in CFFI. I guess we could, but only in dc_event_get_data2_str. Would Android like that?

And alternative is to introduce another event, MsgReadV2. If the fact that this change is breaking is icky to you, let me know and I'll do that. It's easy.

BREAKING CHANGE: previously this event only fired
if message state really did just transition
from `DC_STATE_OUT_DELIVERED` to `DC_STATE_OUT_MDN_RCVD`.
Now this is only the case for `MsgRead` events
that have the newly added `first_time == true`.

Closes deltachat/deltachat-desktop#5220.

This is also useful for channels
as it facilitates updating the post (message) read count live.

Despite the fact that it's a breaking change,
this should not be problematic in most cases
because clients mostly use this event as an "it's time to reload"
indicator.

There is a case in Delta Chat Desktop where and adjustment
will be needed:
https://github.com/deltachat/deltachat-desktop/blob/d1fbb309793934b3ca09ed5a0266b6c84e333dd0/packages/frontend/src/stores/messagelist.ts#L119-L123
It seems that the message state could later transition
to `DC_STATE_OUT_FAILED`, so we should not uncoditionally set it
to `DC_STATE_OUT_MDN_RCVD`.

Note that this does not expose `first_time` in CFFI.
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.

read receipts in "message info" only updates once

1 participant