Skip to content

Handles: Get rid of incorrect signature of bind(handle: IFluidHandle) #24169

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

Closed

Conversation

markfields
Copy link
Member

Description

The interface IFluidHandleInternal specifies that bind takes an IFluidHandleInternal. But some implementations have signature that takes IFluidHandle. This is about to cause trouble as I am preparing to migrate bind to a subset (wider type) of IFluidHandleInternal. (See prototype PR #24163)

Breaking Changes

Even though some of these types are legacy-alpha, bind is only called internally, and the handles we pass are always "internal" handles, so it's not an issue.

@Copilot Copilot AI review requested due to automatic review settings March 27, 2025 05:02
@markfields markfields requested review from a team as code owners March 27, 2025 05:02
@github-actions github-actions bot added area: dds Issues related to distributed data structures area: dds: tree area: runtime Runtime related issues area: tests Tests to add, test infrastructure improvements, etc public api change Changes to a public API base: main PRs targeted against main branch labels Mar 27, 2025
Copy link
Contributor

@Copilot Copilot AI left a 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 pull request fixes the incorrect signature for the bind method by removing the legacy parameter of type IFluidHandle and ensuring that production code calls bind with a properly converted IFluidHandleInternal. Key changes include:

  • Removing the parameter from bind in several test and mock implementations.
  • Updating API report files to reflect the new signature using IFluidHandleInternal.
  • Adjusting production code in dataStoreRuntime.ts to convert the handle before passing it to bind.

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/dds/test-dds-utils/src/ddsFuzzHandle.ts Removed the bind parameter to align with internal handle usage.
packages/runtime/test-runtime-utils/src/mocks.ts Removed the bind parameter in the test mocks.
packages/runtime/container-runtime/src/blobManager/blobManager.ts Removed the bind parameter in BlobHandle, throwing an error as expected.
packages/test/test-end-to-end-tests/src/test/gc/gcUnknownHandles.spec.ts Removed the bind parameter in the test handle implementation.
experimental/dds/tree/src/test/utilities/TestSerializer.ts Removed the bind parameter in the test serializer handle.
packages/runtime/test-runtime-utils/api-report/test-runtime-utils.legacy.alpha.api.md Updated API report to use IFluidHandleInternal in the bind signature.
packages/runtime/datastore/api-report/datastore.legacy.alpha.api.md Updated API report to use IFluidHandleInternal in the bind signature.
packages/runtime/datastore/src/dataStoreRuntime.ts Updated the bind call to convert the handle and adjusted the bind signature accordingly.
Comments suppressed due to low confidence (2)

packages/runtime/test-runtime-utils/src/mocks.ts:960

  • [nitpick] The test mock's bind method no longer accepts a handle parameter while production code still calls bind with an argument. Consider either updating the mocks to accept an optional parameter or adding documentation to clarify this intentional difference.
public bind(): void {

packages/runtime/datastore/src/dataStoreRuntime.ts:563

  • Ensure that the conversion function toFluidHandleInternal reliably returns a valid IFluidHandleInternal instance. This will prevent potential runtime issues when passing the handle to the updated bind method.
this.bind(toFluidHandleInternal(channel.handle));

Copy link
Contributor

github-actions bot commented Apr 9, 2025

🔗 No broken links found! ✅

Your attention to detail is admirable.

linkcheck output


> fluid-framework-docs-site@0.0.0 ci:check-links /home/runner/work/FluidFramework/FluidFramework/docs
> start-server-and-test "npm run serve -- --no-open" 3000 check-links

1: starting server using command "npm run serve -- --no-open"
and when url "[ 'http://127.0.0.1:3000' ]" is responding with HTTP status code 200
running tests using command "npm run check-links"


> fluid-framework-docs-site@0.0.0 serve
> docusaurus serve --no-open

[SUCCESS] Serving "build" directory at: http://localhost:3000/

> fluid-framework-docs-site@0.0.0 check-links
> linkcheck http://localhost:3000 --skip-file skipped-urls.txt

Crawling...

Stats:
  163664 links
    1315 destination URLs
    1547 URLs ignored
       0 warnings
       0 errors


@@ -602,7 +602,7 @@ export class FluidDataStoreRuntime
this.makeVisibleAndAttachGraph();
}

public bind(handle: IFluidHandle): void {
public bind(handle: IFluidHandleInternal): void {
// If visible, attach the incoming handle's graph. Else, this will be done when we become visible.
if (this.visibilityState !== VisibilityState.NotVisible) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like the toFluidHandleInternal calls on 608 and 611 aren't needed anymore

@markfields
Copy link
Member Author

Perfect timing, stale-bot, I just opened #24859 to delete bind altogether, so this is indeed obsolete

@markfields markfields deleted the handles/bind-sig-cleanup branch June 17, 2025 05:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: dds: tree area: dds Issues related to distributed data structures area: runtime Runtime related issues area: tests Tests to add, test infrastructure improvements, etc 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