Skip to content

Comments

Move handle transformation to SharedObject#18335

Closed
anthony-murphy wants to merge 5 commits intomicrosoft:mainfrom
anthony-murphy:mv-handle-transformtion
Closed

Move handle transformation to SharedObject#18335
anthony-murphy wants to merge 5 commits intomicrosoft:mainfrom
anthony-murphy:mv-handle-transformtion

Conversation

@anthony-murphy
Copy link
Contributor

Move handle transformation to SharedObject

@github-actions github-actions bot added area: dds Issues related to distributed data structures area: dds: sharedstring area: dds: tree public api change Changes to a public API base: main PRs targeted against main branch labels Nov 15, 2023
@msfluid-bot
Copy link
Collaborator

@fluid-example/bundle-size-tests: -12 Bytes
Metric NameBaseline SizeCompare SizeSize Diff
aqueduct.js 447.53 KB 447.48 KB -48 Bytes
connectionState.js 680 Bytes 680 Bytes No change
containerRuntime.js 240.63 KB 240.63 KB No change
loader.js 178.97 KB 178.97 KB No change
map.js 48.06 KB 48.12 KB +60 Bytes
matrix.js 141.84 KB 141.84 KB No change
odspDriver.js 90.38 KB 90.38 KB No change
odspPrefetchSnapshot.js 41.9 KB 41.9 KB No change
sharedString.js 162.75 KB 162.7 KB -48 Bytes
sharedTree2.js 277.19 KB 277.21 KB +24 Bytes
Total Size 1.74 MB 1.74 MB -12 Bytes

Baseline commit: bbc50a7

Generated by 🚫 dangerJS against 4e16873

// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
this.services!.deltaConnection.submit(content, localOpMetadata);
this.services!.deltaConnection.submit(
makeHandlesSerializable(content, this.serializer, this.handle),
Copy link
Member

Choose a reason for hiding this comment

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

Note: reSubmitCore below will need to be updated as well, either to inline submitLocalMessage without this makeHandlesSerializable call, or to decode the handles first (but that seems like wasted CPU to round-trip; not worth it merely to share 2 straightforward lines of code)

// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
this.services!.deltaConnection.submit(content, localOpMetadata);
this.services!.deltaConnection.submit(
makeHandlesSerializable(content, this.serializer, this.handle),
Copy link
Member

@markfields markfields Nov 16, 2023

Choose a reason for hiding this comment

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

I'm curious what your approach would be for migrating external DDSes over. This appears to be a breaking behavior change to submitLocalMessage, in which case they'd need to update in the same PR that bumps to this version.

Although as I write that, I wonder if it's not actually, since I believe makeHandlesSerializable is idempotent.

Copy link
Contributor Author

@anthony-murphy anthony-murphy Jan 5, 2024

Choose a reason for hiding this comment

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

makeHandlesSerializable is idempotent, but we won't see those handles, so we'll want them to stop pre-encoding, probably want to log errors somehow

localOpMetadata: unknown,
) => {
this.process(message, local, localOpMetadata);
this.process(parseHandles(message, this.serializer), local, localOpMetadata);
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure why this would change. The end-to-end outbound path has the same result, and the inbound path wouldn't change. We could change it here, but might be better to keep for a follow-up. In the PR as it is, I feel like processCore in each DDS would need to be updated correspondingly to this change.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

since it is idempotent this doesn't hurt, and it would be best if dds didn't need to worry about it at all, its weird to say they need to decode but shouldn't encode

},
applyStashedOp: (content: any): unknown => {
return this.applyStashedOp(content);
return this.applyStashedOp(parseHandles(content, this.serializer));
Copy link
Member

Choose a reason for hiding this comment

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

Same as above - I don't think this belongs in this PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the goal is the op comes back is the same way it left. since it is idempotent this doesn't hurt, and it would be best if dds didn't need to worry about it at all, its weird to say they need to decode but shouldn't encode

@anthony-murphy anthony-murphy deleted the mv-handle-transformtion branch February 15, 2024 22:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: dds: sharedstring area: dds: tree area: dds Issues related to distributed data structures 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