fix: resync client COMMANDS with live API to unblock CI - #28
Merged
Conversation
The api-sync test compares client.ts COMMANDS against the live OpenAPI spec, so it fails every open PR once the server API drifts. It is currently red on main for reasons unrelated to any open PR. - Drop salvage_wreck and sell_ship: both were removed server-side (no handler, protocol MsgType, or help entry remains in the gameserver). The client was advertising two dead commands to players. - Add the 19 shipped endpoints missing from COMMANDS (ship buy orders, battle log/summary, hunt, inspect, shipping, observation + notification mute, login_link device flow, outpost/espionage/garages). - Only treat POST spec paths as commands. GET /api/catalog.json is a bulk download, not a command, and must not be required in COMMANDS.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
src/api-sync.test.tschecksclient.tsCOMMANDS against the live OpenAPI spec, so it goes red on every open PR as soon as the server API drifts. It is currently failing onmainand is blocking #26 and #27, neither of which touches COMMANDS.Changes
Removed 2 dead commands.
salvage_wreckandsell_shipno longer exist server-side — no handler, protocolMsgType, or help entry remains in the gameserver, and the release notes recordsalvage_wreckas removed. The client was advertising both to players. Replacements already shipped in the client:loot_wreck/tow_wreck→sell_wreck/scrap_wreck, andlist_ship_for_sale/sell_ship_to_order/scrap_ship.Added the 19 shipped endpoints missing from COMMANDS — ship buy orders, battle log/summary,
hunt,inspect,shipping, observation + notification mute, thelogin_linkdevice flow, and outpost/espionage/garages. Args are taken from the spec's request schemas.Test fix: only POST spec paths are commands.
GET /api/catalog.jsonis a bulk download and was being demanded as a COMMANDS entry.Note for the dev team
Two things about this check worth a look, not addressed here:
A nightly job, or failing closed on 429, would make this deterministic.
Verification
Lint,
version.test.ts(71 pass), andapi-sync.test.tsall pass locally. The api-sync run was confirmed to be a real fetch (3expect()calls), not the 429 skip path.🤖 Generated with Claude Code