-
Notifications
You must be signed in to change notification settings - Fork 548
Interval Collection: Maintain interval instances across resubmits #24871
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
base: main
Are you sure you want to change the base?
Conversation
…to ic/only-refs
…to ic/reduce-stickiness
🔗 No broken links found! ✅ Your attention to detail is admirable. linkcheck output
|
…to ic/only-refs
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.
Pull Request Overview
This PR improves interval handling across resubmits by refining the interval rebasing logic, endpoint management, and sliding reference preferences.
- Introduces a new rebaseEndpoints method and associated updates in the SequenceIntervalClass.
- Adjusts the rebasing and local metadata schema to support detailed endpoint information and the detached state.
- Updates sliding preference logic through computed stickiness and adds new client getters for tree endpoints.
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
packages/dds/sequence/src/test/intervalIndexTestUtils.ts | Improved assert message for start position to enhance test clarity. |
packages/dds/sequence/src/intervals/sequenceInterval.ts | Added a rebaseEndpoints method and updated interval creation logic to use computed stickiness. |
packages/dds/sequence/src/intervalCollectionMapInterfaces.ts | Updated the type of the rebased metadata to support detailed endpoint objects and a detached state. |
packages/dds/sequence/src/intervalCollection.ts | Revised interval rebasing logic with enhanced detached endpoint handling and local interval updates. |
packages/dds/merge-tree/src/client.ts | Added getters for startOfTree and endOfTree to support new endpoint handling strategies. |
Comments suppressed due to low confidence (1)
packages/dds/sequence/src/intervalCollection.ts:1485
- [nitpick] Add a clarifying comment explaining the rationale for returning 'detached' endpoints in this block to improve future maintainability.
if (rebasedEndpoint === "detached") {
@@ -782,8 +814,7 @@ export function createSequenceInterval( | |||
op, | |||
fromSnapshot, | |||
slidingPreference: startSlidingPreference, | |||
canSlideToEndpoint: | |||
canSlideToEndpoint && startSlidingPreference === SlidingPreference.BACKWARD, | |||
canSlideToEndpoint: canSlideToEndpoint && stickiness !== IntervalStickiness.NONE, |
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.
this condition is a bit suspect, however i think it is correct, as only NONE intervals should become detached.
5a576c8
to
2de2e16
Compare
This pull request introduces enhancements to the
merge-tree
andsequence
packages, focusing on improving interval rebasing logic, endpoint handling, and reference sliding preferences. The changes aim to make the interval rebasing process more robust and better handle detached intervals.Enhancements to Interval Rebasing Logic:
rebaseReferenceWithSegmentSlide
to always return ({ segment, offset }
) instead of simple positions. Thie reduces conversations between segments and non-segments which keep the code simpler and easier to understand.Improvements to Endpoint Handling:
rebaseEndpoints
method to theSequenceIntervalClass
for rebasing interval endpoints with updated segment and offset details.*Modified
IntervalAddLocalMetadata
andIntervalChangeLocalMetadata
interfaces to support the newdetached
state and detailed endpoint information.Sliding Preference Updates:
Integration with Merge Tree:
startOfTree
andendOfTree
getters to theClient
class for handling endpoints when intervals slide off the tree.These changes collectively improve the handling of intervals in collaborative scenarios, ensuring more accurate rebasing and better management of detached endpoints.