Fix Tacview continuation-line parsing in telemetry stream#693
Merged
Conversation
The telemetry stream reader was consuming the same bufio.Reader from two goroutines: the background line reader and handleLine() when it followed continuation lines ending with "\". That breaks parsing for multi-line global properties such as Comments in Tacview ACMI streams. Continuation content and the next object record can be interleaved, producing parse failures like: strconv.ParseUint: parsing "====================0": invalid syntax Refactor the reader so the background goroutine owns all reads and assembles a full logical ACMI record before parsing. Add regression tests covering a multi-line Comments record followed by the next global update.
811c263 to
90236da
Compare
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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
This fixes telemetry parsing for ACMI streams containing multi-line continuation
records, such as long global
Commentsvalues in Tacview exports and realtimestreams.
Root Cause
pkg/telemetry/streamer.gowas reading from the samebufio.Readerin twodifferent places:
handleLines()handleLine()when it detected a continuation line ending with\That allowed reads to interleave. When a multi-line global property was present,
part of the continuation block and the following record could be spliced
together, leading to parse errors like:
strconv.ParseUint: parsing "====================0": invalid syntaxChanges
readACMILine()to assemble full logical ACMI records, includingcontinuation lines, before parsing
handleLine()so it only parses an already-assembled recordCommentsrecord followedby the next global update
Validation
make test