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

Sync operations sometimes do not align #193

Open
kegsay opened this issue Jul 6, 2023 · 0 comments
Open

Sync operations sometimes do not align #193

kegsay opened this issue Jul 6, 2023 · 0 comments
Labels
api bug Something isn't working

Comments

@kegsay
Copy link
Member

kegsay commented Jul 6, 2023

In cases where you have two lists:

  • one tracking all rooms
  • one tracking visible rooms

You would expect index positions to match up if they are using the same filters (which they are). In practice this does not seem to always happen:

{
  "all_rooms": SyncList {
    ops: [
      SyncOp { op: Delete, range: None, index: Some(5), room_ids: [], room_id: None },
      SyncOp { op: Insert, range: None, index: Some(0), room_ids: [], room_id: Some("!kCCQTCfnABLKGGvQjo:matrix.org") 
    }],
    count: 4014
  }, "invites": SyncList {
    ops: [], count: 181
  }, "visible_rooms": SyncList {
    ops: [
      SyncOp { op: Delete, range: None, index: Some(6), room_ids: [], room_id: None }, 
      SyncOp { op: Insert, range: None, index: Some(0), room_ids: [], room_id: Some("!kCCQTCfnABLKGGvQjo:matrix.org") 
    }],
    count: 4014
  }
}

or sometimes one list just doesn't have it as an operation at all:

lists={
  "all_rooms": SyncList { ops: [], count: 4014 }, 
  "invites": SyncList { ops: [], count: 181 }, 
  "visible_rooms": SyncList { ops: [SyncOp { op: Delete, range: None, index: Some(11), room_ids: [], room_id: None }, SyncOp { op: Insert, range: None, index: Some(0), room_ids: [], room_id: Some("!zAeWUNBoXONgkVtgqn:mozilla.org") }], count: 4014 }
}

Possibly related to #192 as this will cause DB hits to sometimes see the user as joined, sometimes not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant