V18 refacto - #6
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Refactors protocol-specific decoding to move decoder wiring out of reader.Reader and into internal/context.Context, while making byte-order explicit at call sites and standardizing reader error values.
Changes:
- Introduces
context.Decoders(parameter parser + reliable header parameter counter) and threads it throughcontext.NewContext/ parser constructors. - Simplifies
reader.NewReader(no options) and updates numeric read APIs to take an explicitbinary.ByteOrder. - Updates v16/v18 parameter parsing and multiple command/session parsing call sites + tests to match the new context/reader APIs.
Reviewed changes
Copilot reviewed 28 out of 28 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| parser.go | Switches parser constructors to context.NewContext + context.Decoders. |
| internal/context/context.go | Extends Context to include Decoders; updates NewContext signature. |
| internal/context/decoders.go | Adds decoder interfaces + Decoders struct for protocol wiring. |
| internal/reader/reader.go | Removes options from Reader; makes endian explicit on numeric reads; introduces shared error vars. |
| internal/reader/reader_test.go | Updates reader tests for new NewReader + endian-explicit APIs. |
| internal/errors/erros.go | Adds shared reader error variables. |
| internal/session/session.go | Updates session header parsing to pass explicit endian. |
| internal/session/session_test.go | Updates tests to new context.NewContext signature + decoder wiring. |
| internal/command/command.go | Updates command header parsing to pass explicit endian. |
| internal/command/command_test.go | Updates command tests for new reader/context construction. |
| internal/command/reliable/reliable.go | Moves parameter parsing to ctx.Decoders; adjusts header parsing reads. |
| internal/command/reliable/reliable_test.go | Updates reliable tests to provide context.Decoders. |
| internal/command/reliable/fragment.go | Updates fragment metadata reads for endian-explicit methods; renames ReadRest usage. |
| internal/command/connect/connect.go | Updates connect parsing to pass explicit endian. |
| internal/command/acknowledge/acknowledge.go | Updates acknowledge parsing to pass explicit endian. |
| internal/hooks/hooks_test.go | Updates hook tests to new Reader + Context.Decoders wiring. |
| internal/parameters/v16/*.go | Updates v16 decoding to pass explicit big-endian reads; updates interfaces to context.*. |
| internal/parameters/v16/*_test.go | Updates v16 tests to new NewReader signature. |
| internal/parameters/v18/*.go | Updates v18 decoding to new reader API and context.* interfaces; adjusts endian usage. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Michelprogram
had a problem deploying
to
ci-protected
April 24, 2026 03:18 — with
GitHub Actions
Failure
Michelprogram
had a problem deploying
to
ci-protected
April 24, 2026 19:34 — with
GitHub Actions
Failure
Michelprogram
force-pushed
the
v18-refacto
branch
from
April 24, 2026 19:39
d6514d6 to
a08c59a
Compare
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.
No description provided.