mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-10-06 11:48:24 +00:00
Reverses the decision made one commit earlier to leave this on SharedPreferences. That call was made to avoid a visible regression — seeding asynchronously means a dismissed game can reappear for a frame or two — but chess has few enough users that the regression does not matter, which also removes the reason to carry the old data over. Replaces the whole expect/actual trio (commonMain expect, androidMain SharedPreferences, jvmMain java.util.prefs, iosMain in-memory) with one commonMain ChessDismissedGamesStore over DataStore. That is the payoff from making the preference layer multiplatform in the first commit of this series: the platform now supplies a file location rather than an implementation. iOS gains real persistence as a side effect. Its actual had been an in-memory map, commented as standing in until an iosApp module existed, so dismissals there were lost on every launch. No migration, deliberately. The old stores keep their data and nothing reads it; a user who had dismissed a game sees it once more and dismisses it again. Android writes to a new file (chess_dismissed_games_v2) rather than reusing the old name, so the two cannot be confused. ChessLobbyLogic now seeds the dismissed set in an init launch rather than a property initializer. The seed unions rather than replaces, so a dismissal the user makes before the read lands is not overwritten by it. The two writes are fire-and-forget on the logic's own scope. Desktop gets its store from commons rather than building one itself, so a front end does not need DataStore on its own classpath. The per-OS data directory that SecretEncryption had inlined is now a single commons/jvmMain definition both use, so the key file and the stores land in the same place. 5 tests: unknown user, round trip, per-user isolation, that an empty set removes the key rather than storing an empty one, and that a later save replaces rather than merges. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AXvKXakvup4inNFfAhhr4L