commit ccf6c5adbaec793931f41ddd45b1fa748b4a51ef
parent a08b60856f1386c13aacb1f564214c9486e9dd76
Author: Michael Camilleri <[email protected]>
Date: Wed, 13 May 2026 04:42:14 +0900
Lower MovesUpdater debounce from 1500ms to 500ms
In normal typing, the debounce only delays the last letter of each run — a
cell-change forces an immediate flush for every prior letter — so the old
1500ms value meant the trailing keystroke of each word a collaborator typed
took roughly a second and a half longer to surface than the rest. 500ms is
still well clear of a typical typist's intra-word pause, so the number of
record writes per unit of typing is essentially unchanged.
Co-Authored-By: Claude Opus 4.7 <[email protected]>
Diffstat:
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/Crossmate/Services/AppServices.swift b/Crossmate/Services/AppServices.swift
@@ -46,7 +46,7 @@ final class AppServices {
self.identity = identity
let movesUpdater = MovesUpdater(
- debounceInterval: .milliseconds(1500),
+ debounceInterval: .milliseconds(500),
persistence: persistence,
writerAuthorIDProvider: { await MainActor.run { identity.currentID } },
sink: { gameIDs in
diff --git a/Crossmate/Sync/MovesUpdater.swift b/Crossmate/Sync/MovesUpdater.swift
@@ -45,7 +45,7 @@ actor MovesUpdater {
private var lastSessionPingAt: [UUID: Date] = [:]
init(
- debounceInterval: Duration = .milliseconds(1500),
+ debounceInterval: Duration = .milliseconds(500),
sessionPingStaleInterval: TimeInterval = 20 * 60,
persistence: PersistenceController,
writerAuthorIDProvider: @escaping @Sendable () async -> String?,