]> git.cworth.org Git - lmno.games/commit
anagrams: Again, follow the rule that server events are the source of truth
authorCarl Worth <cworth@cworth.org>
Mon, 9 Mar 2026 01:20:20 +0000 (21:20 -0400)
committerCarl Worth <cworth@cworth.org>
Mon, 9 Mar 2026 01:20:20 +0000 (21:20 -0400)
commit70f99f5fdb575078f1aaac7913ea0ade3f13f3f4
tree646b917d63b5e29a5e473b8fe742de0939bf7e42
parent93ac8cf9b35c0cb27cf6c085f0cbb031d00c3a21
anagrams: Again, follow the rule that server events are the source of truth

Prior code here was returning letters from the rack (claim area) to
the center of the board, but then server events would also return the
letters, resulting in duplicate letters appearing in the center as
ghosts.

Meanwhile, there was an opposite problem in response to the user
pressing backspace in quick succession. Because the client was waiting
for the server to remove the tile from the rack, addiitional presses
of backspace would all apply to the same last tile, ad would fail.

So, now, as of this commit, we remove tiles from the rack with
backspace, (allowing subsequent presses to target subsequent letters)
but wait for the server to tell us the tile has been returned to the
center area. This should keep state in sync and keep things humming
along.
anagrams/anagrams.jsx