-
Notifications
You must be signed in to change notification settings - Fork 549
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
Conversation
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 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));
🔗 No broken links found! ✅ Your attention to detail is admirable. linkcheck output
|
@@ -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) { |
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.
Looks like the toFluidHandleInternal calls on 608 and 611 aren't needed anymore
Perfect timing, stale-bot, I just opened #24859 to delete bind altogether, so this is indeed obsolete |
Description
The interface
IFluidHandleInternal
specifies thatbind
takes anIFluidHandleInternal
. But some implementations have signature that takesIFluidHandle
. This is about to cause trouble as I am preparing to migratebind
to a subset (wider type) ofIFluidHandleInternal
. (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.