Skip to content

ASCRegister apply round 2 — scoreSortType invalid + submissionType missing #19

Closed

Description

@wei18

Status

ASC apply round 2 (post #17 fix): 3 of original 5 errors resolved, but ASC surfaced 2 new fields it expects:

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

  1. ENTITY_ERROR.ATTRIBUTE.TYPE
    scoreSortType: 'ASCENDING' is not a valid value. Expected one of: 'ASC', 'DESC'
  2. ENTITY_ERROR.ATTRIBUTE.REQUIRED
    submissionType: You must provide a value for the attribute 'submissionType'
    ```

`recurrenceRule = "DAILY"` was accepted (guess validated).

Fix

  1. `Packages/SudokuKit/Sources/ASCRegister/Config.swift`: `LeaderboardConfig.sortOrder` value `"ASCENDING"` → `"ASC"` (still ascending = lower-better, matches design.md §How.3.1 "Low to High"). Verify with consistency test.

  2. `Packages/SudokuKit/Sources/ASCRegister/Config.swift`: Add `submissionType: String` field to `LeaderboardConfig`. Best-guess value:

    • `"BEST_SCORE"` — keep user's best time (matches sudoku semantics: improving your record matters; new worse times shouldn't pollute)
    • Alternative: `"MOST_RECENT_SCORE"` — replace each submission. Rejected because users would lose their best.
  3. `Packages/SudokuKit/Sources/ASCRegister/ASCClient.swift` `createLeaderboard`: add `"submissionType": config.submissionType` to the attributes block.

  4. Test: extend `ConfigConsistencyTests.swift` with one assertion per new field (sortOrder == "ASC", submissionType == "BEST_SCORE" across all 3 boards).

Risk

`"BEST_SCORE"` is a best guess. If ASC rejects, try `"BEST"` or check error response for the actual enum set (likely surfaces in 409 body the same way previous rounds did).

Discovery

Via `swift run ASCRegister apply` 2026-05-20 (Phase 10 A2).

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