feat(social): hide social controls on a deleted opponent's seat #286
Reference in New Issue
Block a user
Delete Branch "feature/deleted-seat-social"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Once an opponent deletes their account, their seats stay in every shared game — so the scoreboard still offered add-friend and block (deletion drops the friendship, so the 🤝 even came back for a former friend) and a chat composer with nobody behind it. A friend request sent that way was accepted and stayed pending forever.
SeatView.deleted(trailing FBS field, backward-compatible) +seat.deletedin the backend DTO / gateway DTO, resolved beside the seat display names by a batchaccounts.deleted_atlookup (account.Store.DeletedIDs).SendFriendRequestandBlockagainst a tombstone returnsocial.ErrAccountDeleted(410account_deleted) — the source of truth for an older client.Also checked (no change needed): deleting an account on the opponent's turn ends the game correctly —
Service.Resigndeliberately skips the turn check andengine.ResignSeatonly advances the cursor when the resigner was to move; covered byTestResignOnOpponentTurn.Tests: new integration tests for the refusals and for the seat mark over
/games/:id/state; gateway transcode + UI codec assert the new field; new gamedelta unit tests for mark preservation. Full local run green — go build/vet/gofmt, go test,-tags=integrationbackend suite, svelte-check, vitest (652), vite build.A deleted account keeps its seats in every shared game, so its opponents still saw the add-friend and block controls on the scoreboard (deletion drops the friendship, so the 🤝 even reappeared for a former friend) and a chat composer nobody was behind. A friend request sent that way was accepted by the server and stayed pending forever. The per-viewer game views now mark such a seat (SeatView.deleted, resolved beside the seat display names by a batch accounts.deleted_at lookup) and the client hides every control aimed at it: add-friend, block, and the chat composer (message + nudge) once no reachable opponent is left. Live events carry the game domain's seat standings and so leave the mark unset, so the delta reducers preserve the cached one. SendFriendRequest and Block against a tombstone are refused with social.ErrAccountDeleted (410 account_deleted) — the source of truth for an older client.