fix(ui): placed object markers invisible when loaded via protobuf#230
fix(ui): placed object markers invisible when loaded via protobuf#230
Conversation
Summary of ChangesHello @fank, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses a critical bug preventing certain placed object markers from being visible when mission data was loaded using Protobuf. The core problem stemmed from an inconsistent interpretation of 'show forever' markers across the backend (Go) and frontend. The Go parser converted JSON's Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
Coverage Report for ui
File Coverage
|
||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Code Review
The pull request effectively addresses the issue of placed object markers not rendering when loaded via protobuf. The core problem, where the Go parser converted endFrame=-1 to uint32(0) for protobuf storage, leading to markers being treated as expired in the frontend, has been correctly resolved. The protobuf-decoder.ts now properly normalizes endFrame: 0 back to -1 at the decoder boundary, ensuring the frontend treats these markers as "show forever". The added test cases in protobuf-decoder.test.ts provide good coverage for both the conversion of endFrame=0 to -1 and the preservation of non-zero endFrame values. The updated comment in marker-manager.ts also clarifies the role of INFINITE_FRAME as a legacy sentinel. Overall, the changes are precise, correct, and well-tested, directly solving the reported bug without introducing new issues.
d72cb40 to
6e9f0c1
Compare
The Go parser converts JSON endFrame=-1 to uint32(0) (FrameForever) for protobuf storage. The frontend never normalized this back, so markers with endFrame=0 were treated as expired and never rendered. Add FRAME_FOREVER constant (-1) to types.ts as the single canonical sentinel. The protobuf decoder normalizes 0 → FRAME_FOREVER at the boundary so both JSON and protobuf paths produce identical MarkerDef objects. isInfiniteEnd() checks only FRAME_FOREVER.
6e9f0c1 to
4431b8b
Compare
Summary
endFrame=-1("show forever") touint32(0)(FrameForever) for protobuf storage, but the frontend never normalized this back, causing these markers to be treated as expiredFRAME_FOREVER = -1constant intypes.tsas the single canonical sentinel for "show forever"0 → FRAME_FOREVERat the boundary so both JSON and protobuf paths produce identicalMarkerDefobjectsisInfiniteEnd()checks onlyFRAME_FOREVERinstead of multiple ad-hoc valuesRoot cause: Only the 5 detonated markers (with specific positive endFrame values) were visible. The 17 non-detonated markers had
endFrame=0in protobuf and were silently filtered out becauseisInfiniteEnd(0)returnedfalse.Test plan
endFrame: 0normalizes toFRAME_FOREVER(-1)findPositionIndextreatsFRAME_FOREVERas infinite