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

refactor: add emit_msgs_changed_without_msg_id #6372

Merged
merged 1 commit into from
Jan 1, 2025

Conversation

link2xt
Copy link
Collaborator

@link2xt link2xt commented Dec 28, 2024

Added debug assertions to make sure
MsgsChanged is not emitted with 0 IDs by accident.

src/chat.rs Outdated
@@ -3319,6 +3318,8 @@ pub(crate) async fn mark_old_messages_as_noticed(
context: &Context,
mut msgs: Vec<ReceivedMsg>,
) -> Result<()> {
debug_assert!(!msgs.is_empty());
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why? It's a no-op if msgs is empty, moreover, fetch_new_messages() calls this function unconditionally

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Removed it. It broke all CI indeed.

@link2xt link2xt force-pushed the link2xt/emit_msgs_changed_without_msg_id branch from 5b56137 to f05814d Compare December 29, 2024 06:53
Added debug assertions to make sure
MsgsChanged is not emitted with 0 IDs by accident.
@link2xt link2xt force-pushed the link2xt/emit_msgs_changed_without_msg_id branch from f05814d to 8a6e35e Compare December 29, 2024 07:08
@link2xt link2xt merged commit 1089aea into main Jan 1, 2025
37 checks passed
@link2xt link2xt deleted the link2xt/emit_msgs_changed_without_msg_id branch January 1, 2025 20:50
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.

2 participants