Skip to content

fix(asc-register): RRULE format + strictly-future recurrenceStartDate - #27

Merged
wei18 merged 1 commit into
mainfrom
fix/asc-rrule-and-future-start
May 20, 2026
Merged

wei18 merged 1 commit into
mainfrom
fix/asc-rrule-and-future-start

Conversation

@wei18

@wei18 wei18 commented May 20, 2026

Copy link
Copy Markdown
Owner

Closes #26. Round 5 fixes — recurrenceRule = FREQ=DAILY;INTERVAL=1 (RFC 5545); recurrenceStartDate = next UTC midnight strictly > now (was current UTC midnight, which Apple rejected as past). 352/352. 🤖 Claude Code

…#26)

Closes #26. ASC apply round 5 returned 2 errors:

  1. recurrenceRule: 'DAILY' invalid. Format must be
     'FREQ=[MINUTELY,HOURLY,DAILY];INTERVAL=$INT'
  2. recurrenceStartDate: Recurring leaderboard start can not be in the past

Apple uses iCalendar RFC 5545 RRULE syntax + strict future-only start.

Changes:
- recurrenceRule: 'DAILY' → 'FREQ=DAILY;INTERVAL=1' (RFC 5545)
- currentRecurrenceStartDateUTC() renamed to nextRecurrenceStartDateUTC().
  Algorithm: UTC calendar floor → if today midnight <= now, add 86,400s
  (tomorrow midnight); else today midnight (defensive). Result is
  strictly > input in every call.
- Old RecurrenceStartDateTests deleted; new NextRecurrenceStartDateTests
  covers mid-day/exact-midnight/late-night/month-boundary/strictly-after
  audit (5 tests).

Tests 350 → 352. 0 warnings.

§未決 (logged): empirical validation of FREQ=DAILY;INTERVAL=1 cycle
reset window — won't know until apply succeeds and we observe ASC's
behavior at UTC midnight rollover.
@wei18
wei18 merged commit 295c331 into main May 20, 2026
@wei18
wei18 deleted the fix/asc-rrule-and-future-start branch May 20, 2026 08:08
wei18 added a commit that referenced this pull request May 20, 2026
…dary (#30)

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
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.

ASC apply round 5 — recurrenceStartDate future-only + recurrenceRule needs RFC 5545 RRULE

1 participant