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

Deprecate previousInterval/nextInterval APi from IntervalCollection #18060

Merged

Conversation

clarenceli-msft
Copy link
Contributor

@clarenceli-msft clarenceli-msft commented Oct 30, 2023

AB#5288

According to https://github.com/clarenceli-msft/FluidFramework/blob/596f777e38fbf2b7474196b4c65a80b4dfc16333/.changeset/happy-dreams-sing.md

As title, the functionality of previousInterval and nextInterval are shifted to endpointIndex. The only usage of these functionalities occurs in table-document fluid example, some workarounds are included

@clarenceli-msft clarenceli-msft requested review from a team as code owners October 30, 2023 16:43
@github-actions github-actions bot added area: dds Issues related to distributed data structures area: dds: sharedstring area: examples Changes that focus on our examples public api change Changes to a public API base: main PRs targeted against main branch labels Oct 30, 2023
@clarenceli-msft clarenceli-msft requested a review from a team as a code owner November 1, 2023 21:24
@msfluid-bot
Copy link
Collaborator

msfluid-bot commented Nov 20, 2023

@fluid-example/bundle-size-tests: +14 Bytes
Metric NameBaseline SizeCompare SizeSize Diff
aqueduct.js 450.63 KB 450.63 KB +2 Bytes
connectionState.js 680 Bytes 680 Bytes No change
containerRuntime.js 240.94 KB 240.94 KB No change
loader.js 167.41 KB 167.41 KB +2 Bytes
map.js 48.05 KB 48.05 KB +2 Bytes
matrix.js 141.84 KB 141.84 KB +2 Bytes
odspDriver.js 90.35 KB 90.36 KB +2 Bytes
odspPrefetchSnapshot.js 41.82 KB 41.82 KB +2 Bytes
sharedString.js 162.77 KB 162.77 KB No change
sharedTree2.js 284.23 KB 284.23 KB No change
Total Size 1.74 MB 1.74 MB +14 Bytes

Baseline commit: 4100024

Generated by 🚫 dangerJS against 5d6b8fe

@@ -78,8 +78,7 @@ export class TableDocument extends DataObject<{ Events: ITableDocumentEvents }>
}

public async getRange(label: string) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we have test coverage if you break this function?

Assuming yes, let's avoid changing the public API of SparseMatrix: you already need to make a cast of something that isn't SharedString to a SharedString.

Instead, you should create the endpoint interval index inside the DataObject here and use nextInterval directly.

Copy link
Contributor

Choose a reason for hiding this comment

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

if you wanted, you could change the signature of the index creation methods to only take in SharedSegmentSequence instead of SharedString, which would legitimize this call and still work, but I'm not sure the distinction is something we really want long-term considering we kind of want to deprecate all of the other shared sequences. So I think just doing the cast here is superior for now.

Copy link
Contributor

Choose a reason for hiding this comment

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

If we don't have test coverage for this method breaking, you should add such a test in table-document as it's plausible we could at some point break it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I found there existed the test coverage on this method (but not tested directly). The method is invoked when the tableDocument creates a slice. Additionally, it requires the label to obtain the intervalCollection, which is not externally accessible. I believe it should be acceptable as long as incorporating the interval index does not break the current tests.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, if intentionally breaking this method causes existing tests to fail, I think we're fine. Thanks for checking!

@clarenceli-msft clarenceli-msft merged commit 05fb45d into microsoft:main Nov 28, 2023
25 checks passed
@clarenceli-msft clarenceli-msft deleted the remove-auto-index-in-collection-3 branch November 28, 2023 20:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: dds: sharedstring area: dds Issues related to distributed data structures area: examples Changes that focus on our examples base: main PRs targeted against main branch public api change Changes to a public API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants