-
Notifications
You must be signed in to change notification settings - Fork 532
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
Remove extra calls to bind when not attached #21213
Changes from all commits
c92cc61
5dec82a
b1613a1
0f2311c
53a9f66
3775af7
ca1c5ca
0d39ac9
6040a46
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,7 +20,12 @@ import type { | |
} from "@fluidframework/runtime-definitions/internal"; | ||
import { SummaryTreeBuilder } from "@fluidframework/runtime-utils/internal"; | ||
import type { IFluidSerializer } from "@fluidframework/shared-object-base/internal"; | ||
import { SharedObject, ValueType, parseHandles } from "@fluidframework/shared-object-base/internal"; | ||
import { | ||
SharedObject, | ||
ValueType, | ||
bindHandles, | ||
parseHandles, | ||
} from "@fluidframework/shared-object-base/internal"; | ||
import { type ITelemetryLoggerExt, UsageError } from "@fluidframework/telemetry-utils/internal"; | ||
import path from "path-browserify"; | ||
|
||
|
@@ -38,7 +43,7 @@ import type { | |
ISerializedValue, | ||
} from "./internalInterfaces.js"; | ||
import type { ILocalValue } from "./localValues.js"; | ||
import { LocalValueMaker, makeSerializable } from "./localValues.js"; | ||
import { LocalValueMaker } from "./localValues.js"; | ||
|
||
// We use path-browserify since this code can run safely on the server or the browser. | ||
// We standardize on using posix slashes everywhere. | ||
|
@@ -1307,11 +1312,7 @@ class SubDirectory extends TypedEventEmitter<IDirectoryEvents> implements IDirec | |
|
||
// Create a local value and serialize it. | ||
jzaffiro marked this conversation as resolved.
Show resolved
Hide resolved
|
||
const localValue = this.directory.localValueMaker.fromInMemory(value); | ||
const serializableValue = makeSerializable( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @markfields I actually don't think this can be removed - without this, the visibility of the datastores is not getting set correctly. This also predated #19242, so I would think it's ok to leave. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As discussed - sounds like a bug. We'll follow up separately. |
||
localValue, | ||
this.serializer, | ||
this.directory.handle, | ||
); | ||
bindHandles(localValue, this.serializer, this.directory.handle); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For when we revisit this - I think it can/should go in the |
||
|
||
// Set the value locally. | ||
const previousValue = this.setCore(key, localValue, true); | ||
|
@@ -1325,7 +1326,7 @@ class SubDirectory extends TypedEventEmitter<IDirectoryEvents> implements IDirec | |
key, | ||
path: this.absolutePath, | ||
type: "set", | ||
value: serializableValue, | ||
value: { type: localValue.type, value: localValue.value as unknown }, | ||
}; | ||
this.submitKeyMessage(op, previousValue); | ||
return this; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ import type { TypedEventEmitter } from "@fluid-internal/client-utils"; | |
import type { IFluidHandle } from "@fluidframework/core-interfaces"; | ||
import { assert, unreachableCase } from "@fluidframework/core-utils/internal"; | ||
import type { IFluidSerializer } from "@fluidframework/shared-object-base/internal"; | ||
import { ValueType, bindHandles } from "@fluidframework/shared-object-base/internal"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You can also delete this function, it's not used anywhere else, and isn't an ideal implementation. @Abe27342 what's the task you pinged me about fixing the function? We can close it if this PR works out. |
||
import { ValueType } from "@fluidframework/shared-object-base/internal"; | ||
|
||
import type { ISharedMapEvents } from "./interfaces.js"; | ||
import type { | ||
|
@@ -299,10 +299,6 @@ export class MapKernel { | |
|
||
// If we are not attached, don't submit the op. | ||
if (!this.isAttached()) { | ||
// this is necessary to bind the potential handles in the value | ||
// to this DDS, as we do not walk the object normally unless we | ||
// are attached | ||
bindHandles(localValue.value, this.serializer, this.handle); | ||
return; | ||
} | ||
|
||
|
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.
Do we know why these aren't necessary anymore?
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.
I think they were unrelated, but I have format on save turned on and it removed a bunch of lints that were no longer used apparently.