Repository navigation
fix(ui): map VIRTUAL/LOGIC per-frame sides in v2 decoder - #568
Merged
Merged
Conversation
Backport parity with the v1 decoder: the v2 streaming path writes the raw side string into SoldierState, but ProtobufDecoderV2.mapSideString did not handle "VIRTUAL"/"LOGIC", so virtual/zeus units in v2 recordings were misclassified as CIV (wrong color, filters, and side-derived stats). Add regression test covering both VIRTUAL and LOGIC per-frame sides.
fank
marked this pull request as ready for review
October 18, 2026 15:34
Coverage Report for ui
File Coverage
|
||||||||||||||||||||||||||||||||||||||
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.
What
Backport parity with the v1 decoder for the v2/WebSocket streaming path:
ProtobufDecoderV2.mapSideStringdidn't handle"VIRTUAL"/"LOGIC", so per-frame soldier states for virtual/zeus units in v2 recordings decoded as"CIV".The v2 writer stores the raw side string in
SoldierState.side(internal/ingestion/writer_v2.go,Side: st.Side), but the decoder's mapping fell through to the"CIV"default — the same mapping in the v1 decoder (protobufDecoder.ts) mapsVIRTUAL/LOGICto"VIRTUAL".Why
The virtual-faction feature (web #556 / extension #211) relies on units with side
VIRTUALto render with virtual-side colors, pass side filters, and be counted in side-derived stats. In v2/streaming recordings they were misclassified as CIV.Change
ui/src/data/decoders/protobufDecoderV2.ts: addVIRTUAL/LOGIC→"VIRTUAL"tomapSideString(mirrors v1).ui/src/data/decoders/__tests__/protobufDecoderV2.test.ts: regression test decodingVIRTUALandLOGICper-frame sides →"VIRTUAL"(fails before, passes after).Verification
tsc --noEmitPASS,eslint src/PASS (0 errors), fulltest:coveragePASS (2187 tests),buildPASS.Not in scope (follow-ups from the #220 post-merge review)
ConnectEvent/EndMissionEventare declared but never written (connects/endMission flow throughGeneralEvent) — schema cleanup only, no functional loss.streamingrows topending, which can leave orphanedfailedrows — needs a design decision.