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

WIP: refactor: add failing test: arhive updated event #5764

Conversation

WofWca
Copy link
Contributor

@WofWca WofWca commented Jul 10, 2024

This is a stub MR to highlight the issue.

This makes the test fail (and rightly so).

This is the cause of #5768

TBH I have no idea how to fix it, where to add emit_msgs_changed(DC_CHAT_ID_ARCHIVED_LINK when a chat is noticed, there doesn't seem to be one universal place for it, it's all mostly SQL.

But if someone has an idea, I could try to finish this, or just share my findings.

Also perhaps you would disagree with changing the test this way because these kids of tests are mostly put in chatlist_event.rs. But IDK seems a little weird to me to split them like this.

For reference, here is the history of related changes:

  1. "archive" consistency and improvements #3918
  2. Emit DC_EVENT_MSGS_CHANGED for DC_CHAT_ID_ARCHIVED_LINK when the number of archived chats with unread messages increases (#3940) #3959 - We emit when the counter increases, but not when it decreases, so IMO it doesn't actually close Archive-Link ChatListItem should get some kind of chat changed event when its unread counter should change #3940
  3. api: add ChatListChanged and ChatListItemChanged events #4476 - this doesn't affect archive events too much, apparently, it only adds extra ChatlistItemChanged and ChatlistChanged events on top of MsgsChanged

Comment on lines 5889 to 5894
// mark one of the archived+muted chats as noticed: check that the archive-link counter is changed as well
marknoticed_chat(&t, claire_chat_id).await?;
assert_eq!(bob_chat_id.get_fresh_msg_cnt(&t).await?, 2);
assert_eq!(claire_chat_id.get_fresh_msg_cnt(&t).await?, 0);
wait_for_chatlist_and_specific_item(&t, DC_CHAT_ID_ARCHIVED_LINK).await;
assert_eq!(DC_CHAT_ID_ARCHIVED_LINK.get_fresh_msg_cnt(&t).await?, 1);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the place where it fails

@WofWca
Copy link
Contributor Author

WofWca commented Jul 12, 2024

Superseded by #5771

@WofWca WofWca closed this Jul 12, 2024
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.

Archive-Link ChatListItem should get some kind of chat changed event when its unread counter should change
1 participant