FluidFramework icon indicating copy to clipboard operation
FluidFramework copied to clipboard

Audience consistency across Container serialization / rehydration

Open vladsud opened this issue 10 months ago • 3 comments

Make Audience more consistent across Container reloads (from serialized state), and by doing so - get one step closer to having stronger guarantees about Audience.getSelf() behaviors.

The primary motivation for this change - get one step closer to promising that if Audience.getSelf() returns non-undefined value, then Audience.getSelf().client !== undefined. I.e. that presence of new clientId means such user is actually present in Audience (including Audience.getMemeber(Audience.getSelf().clientId) !== undefined). Right now, it's not the case for two reasons:

  1. Broken by reloads from rehydrated state.
  2. "read" connections not waiting for join Signal for "self"

This PR fixes # 1, # 2 is coming next.

We should also expect that applications will have state on the side (in runtime memory) that has to be in sync with Audience (i.e. listen and react to audience events). And that applications could roundtrip such state through Container rehydration / reload process. It's clearly possible for applications to fixup such state through reload, but the less special application needs to do through reload, the better.

Related PR: https://github.com/microsoft/FluidFramework/pull/20768 (preserves clientId across reloads)

vladsud avatar Apr 21 '24 14:04 vladsud

@fluid-example/bundle-size-tests: +570 Bytes
Metric NameBaseline SizeCompare SizeSize Diff
aqueduct.js 452.76 KB 452.76 KB No change
azureClient.js 549.21 KB 549.4 KB +192 Bytes
connectionState.js 680 Bytes 680 Bytes No change
containerRuntime.js 256.01 KB 256.01 KB No change
fluidFramework.js 339.57 KB 339.57 KB No change
loader.js 133.01 KB 133.19 KB +186 Bytes
map.js 41.42 KB 41.42 KB No change
matrix.js 143.41 KB 143.41 KB No change
odspClient.js 517.09 KB 517.28 KB +192 Bytes
odspDriver.js 97.06 KB 97.06 KB No change
odspPrefetchSnapshot.js 41.93 KB 41.93 KB No change
sharedString.js 161.19 KB 161.19 KB No change
sharedTree.js 339.57 KB 339.57 KB No change
Total Size 3.15 MB 3.15 MB +570 Bytes

Baseline commit: fb1c1da1105b70cd7c3bec250bd8617a480005e8

Generated by :no_entry_sign: dangerJS against 7401db6f0a2ba9323777d626efd4b7e2dd86c278

msfluid-bot avatar Apr 21 '24 14:04 msfluid-bot

Related internal document:

vladsud avatar Apr 26 '24 21:04 vladsud

This PR has been automatically marked as stale because it has had no activity for 60 days. It will be closed if no further activity occurs within 8 days of this comment. Thank you for your contributions to Fluid Framework!