FluidFramework
FluidFramework copied to clipboard
Make sure ContainerStateHandler overwrites could be used (not crash)
When ContainerStateHandler overwrites are used, we get into recursive call into Container that is not fully initialized, causing a crash. This is due to a config provider logging events (using logger) as part of retrieving config. This PR breaks this cycle.
UT and internal chat have more details.
The alternative (and simpler) fix is to fix Container.connectionState (and other methods / getters that use this.connectionStateHandler) to be this:
public get connectionState(): ConnectionState {
return this.connectionStateHandler === undefined ? ConnectionState.Disconnected : this.connectionStateHandler.connectionState;
}
The issue with that - it may not be enough, as it same issue could be hit for other members that are initialized in ctor, so it feels like we are better off using config that completely prevents these issues.