Skip to content

fix(handles): Prepare for removal of IFluidHandleInternal.bind #24863

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

markfields
Copy link
Member

@markfields markfields commented Jun 17, 2025

Description

This function was deprecated in #24553 and its removal is tracked by #24557.

This PR addresses these last two usages:

  • Updated some weird old tests that were calling bind on a DataStore's handle
  • FluidObjectHandle.bind implementation, which included tracking pending handles and such. Copied this up to SharedObjectHandle where it belongs. All that logic will be removed from FluidObjectHandle when bind is removed.
  • In some DDS tests we test or do serialization, with no interest in handle binding. But the FluidSerializer implementation requires a valid bind source. So add on a dummy bind function. (right now this is a no-op since all handles have a bind function, but once those are removed this still needs to work)

It will be removed from FluidObjectHandle
when bind is removed from the interface
@github-actions github-actions bot added 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 labels Jun 17, 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 PR removes deprecated usages of IFluidHandleInternal.bind by eliminating legacy binding calls in tests and refactoring the attachment logic in Fluid handle implementations. Key changes include:

  • Updating end-to-end tests in attachRegisterLocalApiTests.spec.ts to replace bind calls with attachGraph.
  • Adding legacy flow comments in FluidObjectHandle to clarify the temporary binding logic.
  • Refactoring SharedObjectHandle to incorporate a pending handles mechanism and new attachGraph logic.

Reviewed Changes

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

File Description
packages/test/test-end-to-end-tests/src/test/attachRegisterLocalApiTests.spec.ts Removed deprecated bind calls and updated variable naming via destructuring for clarity
packages/runtime/datastore/src/fluidHandle.ts Added inline comments to mark the legacy bind/attach flow
packages/dds/shared-object-base/src/handle.ts Refactored attachment logic with new isVisible getter, pendingHandles mechanism, and updated bind method
Comments suppressed due to low confidence (2)

packages/test/test-end-to-end-tests/src/test/attachRegisterLocalApiTests.spec.ts:539

  • [nitpick] The renaming from 'peerDataStore' to 'dataStore2' improves readability. Please ensure the same naming convention is consistently applied across other similar tests.
				const { peerDataStore: dataStore2 } = await createPeerDataStore(

packages/dds/shared-object-base/src/handle.ts:104

  • [nitpick] Consider adding more detail to the comment or documentation for the 'isVisible' getter to clarify its intended behavior in various attachment scenarios.
		if (this.isVisible) {


// Flow of attachment:
Copy link
Contributor

Choose a reason for hiding this comment

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

These tests are strange as in they use internal constructs like bind and attachGraph in an end-to-end test which isn't what an application would do.
I would consider removing these tests or at least not doing this via internal functions. For instance, instead of calling attachGraph() here, dataStore2's handle can be stored in the defaultDataStore's DDS.

Copy link
Contributor

Choose a reason for hiding this comment

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

Doesn't have to be in this PR of course. But these tests don't seem valuable to me.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah they're totally weird! And some of it was just wrong, at least in comments. The changes here were just to remove the spurious bind calls and some minor clean ups I made while trying to follow along.

Copy link
Contributor

Choose a reason for hiding this comment

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

Agreed. I will create a work item to delete / update them.

Copy link
Contributor

@agarwal-navin agarwal-navin left a comment

Choose a reason for hiding this comment

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

Looks good. I left a comment on removing or updating the tests that used bind.

@markfields markfields changed the title fix{handles}: Remove usages of IFluidHandleInternal.bind fix(handles): Remove usages of IFluidHandleInternal.bind Jun 17, 2025
@markfields markfields enabled auto-merge (squash) June 17, 2025 18:50
@markfields markfields disabled auto-merge June 17, 2025 19:33
@markfields
Copy link
Member Author

Waiting to merge until I get a clean run of the partner integration pipeline for test/remove-handle-bind-fn which includes this change as well as actually deleting all implementations of IFluidHandleInternal.bind outside of SharedObjectHandle.

@markfields markfields requested a review from Abe27342 June 19, 2025 14:40
@markfields markfields changed the title fix(handles): Remove usages of IFluidHandleInternal.bind fix(handles): Prepare for removal of IFluidHandleInternal.bind Jun 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants