Skip to content

fix(gamecenter): submitScore ms→centisecond conversion at submit boundary - #30

Merged
wei18 merged 1 commit into
mainfrom
fix/submit-score-centisecond-conversion
May 20, 2026
Merged

wei18 merged 1 commit into
mainfrom
fix/submit-score-centisecond-conversion

Conversation

@wei18

@wei18 wei18 commented May 20, 2026

Copy link
Copy Markdown
Owner

Wires the elapsedSeconds × 100 conversion required by design.md §How.3.1 (ELAPSED_TIME_CENTISECOND ASC formatter, locked in by ASCRegister round 1-5 iterations).

  • LiveGameCenterClient.submitScore does the ONE multiply; SubmitScoreHook seam for testing
  • 3 new tests assert the conversion (251→25100, 0→0, 7200→720000)
  • Public protocol unchanged
  • Live GKLeaderboard call remains deferred (Phase 10 manual integration); spy lock the conversion

352 → 355 tests. 0 warnings.

impl-notes: meetings/2026-05-20_submit-score-centisecond.impl-notes.md

🤖 Claude Code

…dary

Wire the elapsedSeconds × 100 conversion required by design.md §How.3.1
(ASC ELAPSED_TIME_CENTISECOND formatter, locked in by PR #17 + #21 + #23
+ #25 + #27 ASCRegister API shape iterations).

- LiveGameCenterClient.submitScore: compute Int64(elapsedSeconds) × 100;
  pass to SubmitScoreHook (default no-op for backward-compat). Public
  protocol signature unchanged — callers (GameCenterSink, Sink adapter)
  pass elapsedSeconds verbatim.
- LiveGameCenterClientSubmitTests (NEW, 3 tests):
  - 251s → 25100cs
  - 0s → 0cs
  - 7200s (2h cap) → 720_000cs (matches §How.3.1 abandon rule)
- Uses SubmitSpy actor to assert the conversion + leaderboard ID via
  LeaderboardIDs lookup, no GKLeaderboard wiring needed yet.

Files NOT modified (verified clean):
- GameCenterSink.swift — Int passthrough, no double-convert risk
- GameStateTelemetryAdapter.swift — Int passes through
- design.md §How.3.1 — already correct (× 100, mm:ss.SS, centisecond)
- AppComposition/Live.swift — default-arg init means no call-site change

Tests 352 → 355 (+3). 0 warnings.

§未決 (2 deferred to Phase 10): live GKLeaderboard wiring + composition-root
hook injection. Conversion itself locked by spy test.

impl-notes: meetings/2026-05-20_submit-score-centisecond.impl-notes.md
@wei18
wei18 merged commit 6a10b21 into main May 20, 2026
@wei18
wei18 deleted the fix/submit-score-centisecond-conversion branch May 26, 2026 10:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant