Repository navigation
fix(worker): don't fail a whole board on one stop's odd asw_id - #57
Merged
Merged
Conversation
Golemio sometimes sends a non-number in a stop's asw_id.stop, which made the departureboards decode fail for every stop in the request. An undecodable asw_id now decodes to null (numeric strings are accepted), and toBoards falls back to the ASW id in the stop_id (U530Z2P → 530/2). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YW796MB3Ksife2TrUfeytT
|
🚀 Preview deployed: https://preview-57.tablo.run |
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.
Requested by Ilnur · project thread
Before: when Golemio sent a non-number in any stop's
asw_id.stop, decoding the departureboards response failed and every stop in that request showed no departures (Honeycomb:Expected number … at ["stops"][8]["asw_id"]["stop"]on an 8-stop board, tracef9b8fc9337738213e3cfba28b21228c7).After: the other stops decode as usual, and the odd stop still gets its departures, matched through its
stop_id.How:
PidStop.asw_idaccepts numbers or numeric strings, and anything else decodes tonullviaSchema.catchDecodinginstead of failing.toBoardsfalls back toparseAswStopId(stop_id)(U530Z2P→ node 530, stop 2) whenasw_idis null. A test covers a null stop, numeric strings and a garbageasw_idin one response.Generated by Claude Code