2

I have the DataObject like this:

protected async initializingFirstTime() {
    const sequence = SharedObjectSequence.create(this.runtime);
    this.root.set("sequence", sequence.handle);
}

public async insertNode () {
    const children = await this.root.get<IFluidHandle<SharedObjectSequence<IFluidHandle<SharedMap>>>>("sequence").get();
    const map = SharedMap.create(this.runtime)
    children.insert(0, [map.handle as IFluidHandle<SharedMap>])
}

I definition insertNode method and try to insert children node when user typed some content.

But after init this data object and call insertNode(), I got the error: initialMessages called twice

enter image description here

I just wanner add SharedMap into SharedObjectSequence. Is any wrong for this case?

I reappear this issue by draft-js example, here are commit code and insert-node-test branch

lemon
  • 300
  • 1
  • 6

2 Answers2

2

I believe this is a bug. There is a related issue the Fluid Framework is tracking: https://github.com/microsoft/FluidFramework/issues/3707

Tony
  • 51
  • 1
1

Finally, I find the root cause.

Add the 'SharedMap' into 'SharedObjectSequence' will receive a reply op from the server.

And will execute 'cloneDeep(message)' in 'FluidFramework/packages/dds/sequence/src/sequence.ts'.

The message was content 'routeContext.runtime.context.container._deltaManager.connection._details.initialMessages', if clone it, will call 'initialMessages' twice.

lemon
  • 300
  • 1
  • 6