Skip to content

Fix auction setraid: unwrap paginated OpenDKP /raids envelope - #273

Merged
ebm5025 merged 1 commit into
mainfrom
claude/eqnotify-castle-bot-integration-5c7l4s
Aug 28, 2026
Merged

Fix auction setraid: unwrap paginated OpenDKP /raids envelope#273
ebm5025 merged 1 commit into
mainfrom
claude/eqnotify-castle-bot-integration-5c7l4s

Conversation

@ebm5025

@ebm5025 ebm5025 commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator

What happened

Per the current OpenDKP OpenAPI spec, GET /clients/{client}/raids now returns a paginated envelope rather than a bare array:

// RaidsPageResponse
{ "Raids": [ /* RaidStatsItem */ ], "TotalRaids": 0, "TotalPages": 0, "CurrentPage": 1 }

Our getRaids() cast the response body straight to ODKPRaidData[], so the /auction setraid autocomplete ran .filter/.map on an object, threw, and the catch returned [] → the raids picker showed nothing.

The raid id field is unchanged (RaidStatsItem.RaidId), so no field renames are needed.

Note: an earlier revision of this PR guessed a RaidIdIdRaid rename based on the open-dkp-client GitHub repo. That repo is stale; the authoritative OpenAPI spec keeps RaidId. This revision drops that change and fixes the actual cause (the envelope).

Fix

  • getRaids() unwraps .Raids from the envelope (still tolerates a bare array for older deployments), and requests ?ItemsPerPage=5000 — passing any query param selects the paginated view (up to 5000 raids) instead of the default 50-raid stats view, so the picker sees all raids like before.
  • The setraid autocomplete now logs the failure instead of silently returning [], which is what hid this breakage.

Testing

  • yarn tsc — clean.
  • yarn test:ci — 84 tests pass.
  • The sandbox can't reach OpenDKP (api.opendkp.com is blocked by egress policy), so this wasn't verified end-to-end — please confirm /auction setraid autocompletes after deploy.

🤖 Generated with Claude Code

GET /clients/{client}/raids now returns a paginated envelope
`{ Raids, TotalRaids, TotalPages, CurrentPage }` (RaidsPageResponse) instead
of a bare array. `getRaids()` cast the body straight to `ODKPRaidData[]`, so
the setraid autocomplete's `.filter/.map` ran against an object, threw, and
the `catch` returned an empty list — the raids picker showed nothing.

- getRaids() unwraps `.Raids` from the envelope (still supports a bare array),
  and requests `?ItemsPerPage=5000` so the picker sees all raids rather than
  the default 50-raid stats view.
- The setraid autocomplete now logs the failure instead of silently swallowing
  it, which is what hid this.

The raid id field is unchanged (`RaidId`, per the OpenDKP OpenAPI spec), so no
field-name changes are needed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BWXRmPbtEz35wquwFd8Cu7
@ebm5025
ebm5025 force-pushed the claude/eqnotify-castle-bot-integration-5c7l4s branch from 5dedde4 to a75a886 Compare August 28, 2026 14:52
@ebm5025 ebm5025 changed the title Fix auction setraid raids list after OpenDKP RaidId → IdRaid rename Fix auction setraid: unwrap paginated OpenDKP /raids envelope Aug 28, 2026
@ebm5025
ebm5025 merged commit 565765b into main Aug 28, 2026
1 check passed
@ebm5025
ebm5025 deleted the claude/eqnotify-castle-bot-integration-5c7l4s branch August 28, 2026 15:49
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.

2 participants