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

No MsgsChanged event for archived chats special chat list item when an archived chat is noticed #5768

Closed
Simon-Laux opened this issue Jul 8, 2024 · 3 comments · Fixed by #5771
Assignees
Labels
bug Something is not working

Comments

@Simon-Laux
Copy link
Member

Steps to reproduce:

  • mute multiple chats and archive them
  • receive messages in those chats
  • go to archived chats and read the messages in the chats
  • go back from archived chat list to normal chatlist and notice that the unread counter didn't update

I suspect this is a bug that got masked by the "load first 20 items" in the chatlist that recently got removed in deltachat/deltachat-desktop#4004

Possible solution:

  • when switching to archived mode, remove the "archived chats link" from the chatlist cache for loaded chatlistitems -> it has the id 6 (C.DC_CHAT_ID_ARCHIVED_LINK) so the constant shall be used to identify it
  • or investigate why it isn't updated when chats archived chats are marked as noticed, maybe there is a chatlist update event missing in core for this case. If so it should be solved in core with a new testcase for it.
@Simon-Laux Simon-Laux added the bug Something is not working label Jul 8, 2024
@WofWca WofWca self-assigned this Jul 8, 2024
@WofWca
Copy link
Collaborator

WofWca commented Jul 10, 2024

I think it's a core issue. The listener is invoked when a new unread message appears in the archive, but is not invoked when a message in the archive is read.
The listener does get invoked for the chat itself, but not for the archive.

https://github.com/deltachat/deltachat-desktop/blob/52df8413b1f0315fa95094362e684564dc50f0f5/src/renderer/components/chat/ChatList.tsx#L549-L552

@WofWca
Copy link
Collaborator

WofWca commented Jul 10, 2024

I will try to investigate

WofWca referenced this issue in WofWca/deltachat-core-rust Jul 10, 2024
WofWca referenced this issue in WofWca/deltachat-core-rust Jul 10, 2024
@WofWca WofWca removed their assignment Jul 10, 2024
@iequidoo iequidoo transferred this issue from deltachat/deltachat-desktop Jul 11, 2024
@iequidoo
Copy link
Collaborator

Indeed this looks like #3940 wasn't fixed completely. When an archived chat is read, an MsgsChanged event must be emitted as well.

@iequidoo iequidoo self-assigned this Jul 11, 2024
iequidoo added a commit that referenced this issue Jul 11, 2024
… decrease (#5768)

Emit `MsgsChanged` for DC_CHAT_ID_ARCHIVED_LINK if the number of unnoticed archived chats could
decrease. In general we don't want to make an extra db query to know if a noticied chat is
archived. Emitting events should be cheap, better to allow false-positive `MsgsChanged` events.
iequidoo added a commit that referenced this issue Jul 11, 2024
… decrease (#5768)

Follow-up to 3cf7874 "Emit DC_EVENT_MSGS_CHANGED for
DC_CHAT_ID_ARCHIVED_LINK when the number of archived chats with unread messages increases (#3940)".

In general we don't want to make an extra db query to know if a noticied chat is
archived. Emitting events should be cheap, better to allow false-positive `MsgsChanged` events.
@iequidoo iequidoo changed the title special Chat list item for archived chats does not update unread count No MsgsChanged event for archived chats special chat list item when an archived chat is noticed Jul 11, 2024
iequidoo added a commit that referenced this issue Jul 22, 2024
… decrease (#5768)

Follow-up to 3cf7874 "Emit DC_EVENT_MSGS_CHANGED for
DC_CHAT_ID_ARCHIVED_LINK when the number of archived chats with unread messages increases (#3940)".

In general we don't want to make an extra db query to know if a noticied chat is
archived. Emitting events should be cheap, better to allow false-positive `MsgsChanged` events.
iequidoo added a commit that referenced this issue Jul 22, 2024
… decrease (#5768)

Follow-up to 3cf7874 "Emit DC_EVENT_MSGS_CHANGED for
DC_CHAT_ID_ARCHIVED_LINK when the number of archived chats with unread messages increases (#3940)".

In general we don't want to make an extra db query to know if a noticied chat is
archived. Emitting events should be cheap, better to allow false-positive `MsgsChanged` events.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is not working
Projects
None yet
3 participants