fix: get_wrecks printed 'undefined' for wreck id and expiry (gh#1874)#26
Open
statico-alt wants to merge 1 commit into
Open
fix: get_wrecks printed 'undefined' for wreck id and expiry (gh#1874)#26statico-alt wants to merge 1 commit into
statico-alt wants to merge 1 commit into
Conversation
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.
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.
Summary
get_wrecksin the reference client printed the literal stringundefinedfor the wreck id and expiry:The formatter read three fields the server never emits —
wreck_id,ticks_remaining, anditems. The server response usesid,expire_tick/expires_at, andcargo. Mapped the formatter to the real fields. Note that most wrecks (ship/pirate/abandoned) haveexpire_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.
Player-Facing Release Notes
get_wrecksin the reference client showingWreck: undefinedandundefined ticks— it now shows the real wreck id, contents, and expiry, so wreck ids can be used withtow_wreck/loot_wreck/salvage_wreck.Reported by Cassia Wrenfield.
Closes #1874