fix(go): fix command serialization bugs#3015
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3015 +/- ##
============================================
+ Coverage 71.88% 71.95% +0.06%
Complexity 930 930
============================================
Files 1118 1120 +2
Lines 92992 93179 +187
Branches 70513 70513
============================================
+ Hits 66851 67043 +192
+ Misses 23582 23578 -4
+ Partials 2559 2558 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
@chengxilo could you please check this? |
|
PR description is not good enough. please make it more meaningful: what bug was that, how did it manifest and how was it fixed. prefer on describing why instead of what. |
ryankert01
left a comment
There was a problem hiding this comment.
I think it's better to add a test to prevent regression
we are adding tests in #2973 |
|
@saie-ch so why these tests passed? do those commits overlap? |
@hubcio Thanks for the question! Could you clarify which tests you're referring to? |
In this PR, you better only address the problem of
For the following changes related to commands, it would be better to address them in #2973, since they were discovered while you implementing command tests(and more importantly, they are logic of commands):
Regarding this part
I’m still a bit confused why we tend to separate bug fixes and tests into different PRs. In many cases, writing tests alongside the fix makes it easier to validate the implementation immediately ^v^. |
Sorry for making you confused, actually you just need to use a seperate PR to solve the problem of |
Also I think the tests @hubcio refering to is the tests you implemented for command. As those tests passed it bascially means they didn't detect the bug in |
|
@chengxilo I misunderstood the original review feedback and thought the suggestion was to separate ALL bug fixes from the tests. Now: |
Bugs Fixed:
Permissions.MarshalBinary() - Fixed missing continuation flags between stream/topic entries. The serializer wasn't writing 1-byte flags
(1=has_next, 0=no_next) after each entry, causing the server to incorrectly parse permission data and potentially grant wrong permissions. Also
added
len() > 0checks to match Rust SDK's behavior of skipping empty maps.Note: Does NOT fix #2980, #2981, #2982 (missing 4-byte permissions_len field before permissions data - those are separate issues found during the review of #2973).