Draft
Conversation
5ce8912 to
4f30121
Compare
MarcoPolo
reviewed
Oct 13, 2025
4f30121 to
2ce4fe8
Compare
MarcoPolo
reviewed
Oct 13, 2025
Contributor
MarcoPolo
left a comment
There was a problem hiding this comment.
some small changes, but I think we should merge this.
pubsub.go
Outdated
|
|
||
| messagesInNextRPC := 0 | ||
| messageSlice := rpc.Publish | ||
| var msgIDSlice []string |
Contributor
There was a problem hiding this comment.
reminder to run the fuzzer after this change
pubsub.go
Outdated
| if len(rpc.MsgIDs) == 0 { | ||
| msgIDSlice = make([]string, len(rpc.Publish)) | ||
| } else { | ||
| panic("MsgIDs and Publish have different lengths") |
Contributor
There was a problem hiding this comment.
Is panic the best option? Is there a reason it's unsafe to use rpc.Publish as the source of truth?
Member
Author
There was a problem hiding this comment.
This effectively says: panic if the MessageIDs are present but the length is < rpc.Publish length. I'm panicing here because it'd have paniced in the append later in the loop.
I'm changing this to work for any len of MessageIDs. Slightly ugly but also avoids allocation.
fc75da8 to
3476c19
Compare
3476c19 to
2926d76
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.
fixes: #611