mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-08-10 00:16:59 +00:00
The relay-paging trackers measured elapsed wall-clock with System.currentTimeMillis() directly. Introduce a multiplatform millisecond clock (currentTimeMillis expect/actual across jvm/android/ios/macos/linux, mirroring the existing currentTimeSeconds) exposed as TimeUtils.nowMillis(), and route PerRelayLoadTracker + WindowLoadTracker through it. TimeUtils.now() is seconds, so it can't be used for the ms-scale silence / idle / linger timers — nowMillis() is the correct primitive. No behavior change (same underlying clock on JVM/Android). Note: the two trackers stay in jvmAndroid for now — @Synchronized has no commonMain equivalent. ConcurrentHashMap is kept deliberately: LargeCache is a sorted ConcurrentSkipListMap (Comparable, compareTo-identity keys) and the pager keys (ConvoKey not Comparable; ChatroomKey.compareTo is hashCode-based) don't satisfy that, so ConcurrentHashMap is the correct structure here. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>