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

fix: do not merge awareness sync data info client update sync data #1170

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

LucasXu0
Copy link
Collaborator

@LucasXu0 LucasXu0 commented Jan 17, 2025

  fn receive_local_state(
    &self,
    origin: &CollabOrigin,
    object_id: &str,
    _event: &Event,
    update: &AwarenessUpdate,
  ) {
    let payload = Message::Awareness(update.encode_v1()).encode_v1();
    // ...
      ClientCollabMessage::new_update_sync(update_sync) <- Here

In the previous implementation, the awareness data was associated with the ClientCollabMessage::new_update_sync, which caused the awareness update to be merged into the client update.

@LucasXu0 LucasXu0 marked this pull request as draft January 17, 2025 09:33
&& last.message().payload_size() < self.config.maximum_payload_size
&& last.mergeable()
&& last.merge(&next, &self.config.maximum_payload_size).is_ok()
{
&& next.mergeable()
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

When merging the last and next, we should check if the next is mergeable. If the last is mergeable but the next is NOT, they should not be merged.

@@ -192,7 +192,7 @@ where
trace!("queue awareness: {:?}", update);
}

ClientCollabMessage::new_update_sync(update_sync)
ClientCollabMessage::new_awareness_sync(update_sync)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@Horusiath could you please confirm whether it was a typo or intentional to set the awareness update as update_sync instead of awareness_sync?

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.

1 participant