commit 567baccc7a82efc3f66299a2400be3564ee183f9
parent 2329fba9234266b08cd5288f10f2339bc5a330f5
Author: Michael Camilleri <[email protected]>
Date: Sun, 24 May 2026 07:14:30 +0900
Tweak time for coalescing
Diffstat
| M | Crossmate/Sync/SyncEngine.swift | | | 11 | +++++++---- |
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/Crossmate/Sync/SyncEngine.swift b/Crossmate/Sync/SyncEngine.swift
@@ -290,10 +290,13 @@ actor SyncEngine {
/// Keyed by `GameEntity.databaseScope` (0 = private, 1 = shared).
private var playerSendDebounce: [Int16: Task<Void, Never>] = [:]
/// How long to wait after the first Player enqueue before firing
- /// `sendChanges`. Long enough to absorb a puzzle-open burst (read cursor
- /// + name + cursor track land within ~500 ms), short enough that a true
- /// solo edit doesn't perceptibly defer its push.
- private static let playerSendCoalesceWindow: Duration = .milliseconds(400)
+ /// `sendChanges`. Sized to cover the full puzzle-open burst: read cursor
+ /// and name-open enqueue synchronously, then the cursor-track selection
+ /// arrives after PlayerSelectionPublisher's 500 ms debounce plus an
+ /// actor hop — measured at ~1 s end-to-end on device. 750 ms catches
+ /// the trailing selection in the same batch without perceptibly
+ /// deferring a true solo edit.
+ private static let playerSendCoalesceWindow: Duration = .milliseconds(750)
/// Coalescing variant of `sendChangesDetached` for the Player-record
/// path. The first enqueue in a window schedules a deferred drain;