-
-
Notifications
You must be signed in to change notification settings - Fork 598
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
Refuse splicing the live timeline into a broken position #873
Conversation
Credit to Matthew for basically solving this. Theoretically fixes spontaneous timeline corruption: element-hq/element-web#8593 When the live timeline ends up in a position where it can no longer be live (such as becoming the second timeline in the set, rather than the first) we end up getting neighbouring timeline errors. By refusing to splice the live timeline into such a position, we hopefully keep the live timeline in a position of still being live for when it is next used. The running theory that leads to this fix is multiple limited syncs coming in, causing holes in the timeline. When trying to patch up the holes, the timeline set would end up splicing all over the place, leading to potentially splicing the live timeline into a broken position.
@@ -408,8 +408,21 @@ EventTimelineSet.prototype.addEventsToTimeline = function(events, toStartOfTimel | |||
console.info("Already have timeline for " + eventId + | |||
" - joining timeline " + timeline + " to " + | |||
existingTimeline); | |||
timeline.setNeighbouringTimeline(existingTimeline, direction); | |||
existingTimeline.setNeighbouringTimeline(timeline, inverseDirection); | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the warnings are a bit cryptic here, to the point of being very confusing for the 2nd one. how about:
"Refusing to set a preceding existingTimeLine on our timeline as the existingTimeLine is live"
and
"Refusing to set our preceding timeline on a existingTimeLine as our timeline is live"
perhaps?
lgtm. only other change would be to log the timeline ids so we can do forensics later |
See element-hq/element-web#8593 (comment) Previously (#873) we allowed half-linking timelines to each other if they satisfy the conditions, however this appears to not be helping. Instead, it seems like the timelines are getting stuck in a position where one direction is spliced but the other is broken. To avoid this case, we'll just avoid splicing in both directions when one of the directions is invalid.
See element-hq/element-web#8593 (comment) Previously (#873) we allowed half-linking timelines to each other if they satisfy the conditions, however this appears to not be helping. Instead, it seems like the timelines are getting stuck in a position where one direction is spliced but the other is broken. To avoid this case, we'll just avoid splicing in both directions when one of the directions is invalid.
Credit to Matthew for basically solving this.
Theoretically fixes spontaneous timeline corruption: element-hq/element-web#8593
When the live timeline ends up in a position where it can no longer be live (such as becoming the second timeline in the set, rather than the first) we end up getting neighbouring timeline errors. By refusing to splice the live timeline into such a position, we hopefully keep the live timeline in a position of still being live for when it is next used.
The running theory that leads to this fix is multiple limited syncs coming in, causing holes in the timeline. When trying to patch up the holes, the timeline set would end up splicing all over the place, leading to potentially splicing the live timeline into a broken position.
Disclaimer: I've done light testing on Riot to make sure it doesn't fail in miserable ways, but have not reproduced the case which causes the issue in the first place. The issue is a bit complex to test, hence the word "theory" being littered above.