Skip to content

Golf: remove legacy winner fallback once shared-wins backend rollout completes #231

Description

@aaylward

Background

#230 added support for shared wins (ties) in the golf frontend. The backend now sends a joined display winner string (e.g. "alice & bob") plus a typed winners: string[] list. To stay compatible with servers that predate the winners list, the frontend keeps a fallback to the old name === winner string compare.

Cleanup once the backend rollout is complete

When every deployed golf server reliably sends the winners list, the legacy fallback can be removed:

  • src/apps/golf/components/GolfGame.tsx — in isGameWinner(), drop the name === winner fallback branch and rely solely on winners membership.
  • src/hooks/useGolfGame.ts — consider whether winner (the display string) is still needed alongside winners, or whether the UI can derive its display text from winners directly.
  • src/plugins/golfNetworkPlugin.ts / src/utils/networkAdapter.ts — make winners a required (non-optional) argument on the onGameEnded callback signature once it's always present.
  • Update the gameEnded tests that exercise the "legacy server omits the list" path (golfNetworkPlugin.gameEnded.test.ts, useGolfGame.gameEnded.test.tsx).

Blocked on

Backend shared-wins rollout reaching all environments.

🤖 Generated with Claude Code

https://claude.ai/code/session_01A8ftoV23UzNjLxoyaFQpoW

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions