Skip to content

ASC apply round 3 — recurrenceStartDate + recurrenceDuration required #22

Closed

Description

@wei18

Status

After #19 merged, ASC apply round 3 still 409 — two new required attributes surfaced:

```
status: 409 path: /v1/gameCenterLeaderboards
errors:

  1. ENTITY_ERROR.ATTRIBUTE.REQUIRED
    recurrenceStartDate: You must provide a value for the field 'recurrenceStartDate'
  2. ENTITY_ERROR.ATTRIBUTE.REQUIRED
    recurrenceDuration: You must provide a value for the field 'recurrenceDuration'
    ```

`scoreSortType="ASC"` + `submissionType="BEST_SCORE"` both accepted.

We're playing whack-a-mole with ASC's required attributes (each apply round surfaces a new pair). Time to break the loop.

Fix

Two new fields

Per design.md §How.3.1: "Recurrence 設定: Start Date = 發版當日 UTC 00:00;Duration = 1 day".

  • `recurrenceStartDate`: ISO 8601 datetime string. Use today's UTC 00:00 (computed at apply time, not hardcoded). The Date() formatter should output `yyyy-MM-dd'T'00:00:00Z` shape.
  • `recurrenceDuration`: ISO 8601 duration, value `"P1D"` (1 day).

Both are plain strings at the top level of `attributes`, not nested under `recurrenceRule`.

Plus: new `inspect` subcommand to ASCRegister

To stop the whack-a-mole loop, add an `inspect` subcommand that GETs an existing entity by vendor identifier and prints the full JSON response. Use case: user has a dummy leaderboard `test.bootstrap.delete` in their tenant. Running `swift run ASCRegister inspect --leaderboard test.bootstrap.delete --app-id ...` would print the complete attribute set ASC populated, including any fields we haven't been sending.

Usage:
```
swift run ASCRegister inspect --key --key-id --issuer --app-id --leaderboard
```

Implementation:

  1. Look up gameCenterDetail (same path used by plan/apply)
  2. `getCollection` on `/v1/gameCenterDetails/{id}/gameCenterLeaderboards`
  3. Filter by `vendorIdentifier == --leaderboard arg`
  4. Print all attributes from the matching APIResource

Future dev can run this against the dummy and copy/paste the working shape into Config.swift.

Tests

  • ConfigConsistencyTests: assert `recurrenceStartDate` matches expected ISO 8601 shape (regex `^\d{4}-\d{2}-\d{2}T00:00:00Z$`) and `recurrenceDuration == "P1D"` for all 3 boards.
  • New simple test: `inspect` subcommand parses CLI args correctly.

Risk

If `recurrenceStartDate` shape is wrong (e.g., ASC wants date-only `yyyy-MM-dd` or epoch seconds), apply round 4 will surface. Document fallback formats in §未決.

Discovery

Via `swift run ASCRegister apply` 2026-05-20 (Phase 10 A2 — ASCRegister round 3 of N iterations).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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