Skip to content

SyncEngine: nil-cache seed keeps a partial snapshot when the first regular sync precedes any join #54

Description

@gmliao

Found during review of #53 (same class as the bug fixed there, not worsened by it).

SyncEngine.computeBroadcastDiffFromSnapshot / computePerPlayerDiffFromSnapshot (.cached baseline): when the cache is nil, the first call seeds it with whatever snapshot it was given and returns []. If that first call uses a .dirtyTracking(...) extraction (only some fields present) and happens before any player join has populated the cache via lateJoinSnapshot, the cache holds a partial snapshot and populateCacheIfNeeded does not repair it on the later join. Later diffs then treat the missing fields as new (.set) or as vanished.

Not reachable by EncodingBenchmark or the demo servers (players always join before the first sync), hence a follow-up rather than part of #53.

Fix sketch: seed a nil cache from an .all extraction (the regular path already does this at the runSyncNowCycle call site), or let populateCacheIfNeeded overwrite a partially seeded cache.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions