Skip to content

Fix Tacview continuation-line parsing in telemetry stream#693

Merged
dharmab merged 2 commits into
dharmab:mainfrom
red-one1:fix/tacview-continuation-stream
May 19, 2026
Merged

Fix Tacview continuation-line parsing in telemetry stream#693
dharmab merged 2 commits into
dharmab:mainfrom
red-one1:fix/tacview-continuation-stream

Conversation

@red-one1

Copy link
Copy Markdown
Contributor

Summary

This fixes telemetry parsing for ACMI streams containing multi-line continuation
records, such as long global Comments values in Tacview exports and realtime
streams.

Root Cause

pkg/telemetry/streamer.go was reading from the same bufio.Reader in two
different places:

  • the background goroutine in 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 syntax

Changes

  • make the background reader goroutine the sole owner of ACMI stream reads
  • add readACMILine() to assemble full logical ACMI records, including
    continuation lines, before parsing
  • simplify handleLine() so it only parses an already-assembled record
  • add regression tests for a sample-like multi-line Comments record followed
    by the next global update

Validation

  • make test

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.
@red-one1 red-one1 force-pushed the fix/tacview-continuation-stream branch from 811c263 to 90236da Compare May 18, 2026 11:11

@dharmab dharmab left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the patch!

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@dharmab dharmab merged commit c97aa38 into dharmab:main May 19, 2026
8 checks passed
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.

2 participants