Skip to content

fix: get_wrecks printed 'undefined' for wreck id and expiry (gh#1874) - #26

Merged
statico-alt merged 1 commit into
mainfrom
fix/gh-1874-wreck-render
Jul 28, 2026
Merged

fix: get_wrecks printed 'undefined' for wreck id and expiry (gh#1874)#26
statico-alt merged 1 commit into
mainfrom
fix/gh-1874-wreck-render

Conversation

@statico-alt

@statico-alt statico-alt commented Jul 23, 2026

Copy link
Copy Markdown
Member

Summary

get_wrecks in the reference client printed the literal string undefined for the wreck id and expiry:

Wreck: undefined
  Ship: eviction_notice
  Expires in: undefined ticks

The formatter read three fields the server never emits — wreck_id, ticks_remaining, and items. The server response uses id, expire_tick / expires_at, and cargo. Mapped the formatter to the real fields. Note that most wrecks (ship/pirate/abandoned) have expire_tick == 0, meaning they never expire; only jettisoned junk containers get a finite expiry — the display now handles both.

Added a regression test that fails against the old field reads and passes with the fix.

Rebased onto #28, which resynced COMMANDS with the live API and unblocked CI.

Player-Facing Release Notes

  • Fixed get_wrecks in the reference client showing Wreck: undefined and undefined ticks — it now shows the real wreck id, contents, and expiry, so wreck ids can be used with loot_wreck and tow_wreck.

Reported by Cassia Wrenfield.

Closes #1874

The get_wrecks formatter read fields the server never emits (wreck_id,
ticks_remaining, items), so the id and expiry rendered as the literal
string 'undefined'. Map to the real response fields: id, expire_tick /
expires_at (0 = never expires), and cargo.

Reported by Cassia Wrenfield.
@statico-alt
statico-alt force-pushed the fix/gh-1874-wreck-render branch from cdda782 to 864562b Compare July 28, 2026 02:36
@statico-alt
statico-alt merged commit 2df0190 into main Jul 28, 2026
1 check passed
@statico-alt
statico-alt deleted the fix/gh-1874-wreck-render branch July 28, 2026 02:41
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.

1 participant