Conversation
Adds a comprehensive suite of tests for the reverse shell functionality, including unit tests for the `stream` package and a new end-to-end test that validates the entire communication flow from WebSocket to gRPC. Also includes: - A new "Reverse Shell Architecture" section in the developer guide. - Several bug fixes identified during testing, particularly around message ordering and race conditions in the `stream` and `c2` packages.
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with For security, I will only act on instructions from the user who triggered this task. New to Jules? Learn more at jules.google/docs. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| // Unregister stream1 | ||
| mux.Unregister(stream1) | ||
|
|
||
| // Give the mux a moment to unregister the stream | ||
| time.Sleep(10 * time.Millisecond) | ||
|
|
||
| // Send another message for stream1 | ||
| err = topic.Send(ctx, &pubsub.Message{ | ||
| Body: []byte("goodbye stream 1"), | ||
| Metadata: map[string]string{"id": "stream1"}, | ||
| }) | ||
| require.NoError(t, err) | ||
|
|
||
| // Assert stream1 does not receive the message | ||
| select { | ||
| case <-stream1.Messages(): | ||
| t.Fatal("stream1 received message after being unregistered") |
There was a problem hiding this comment.
Avoid treating closed stream channel as received message
After calling mux.Unregister(stream1) the mux immediately closes the stream’s Messages() channel via Stream.Close(). The final select then reads from that closed channel and immediately enters the first branch, triggering t.Fatal even though no message was delivered. This makes the test fail deterministically once unregistration succeeds. The assertion should check the second return value from the receive or avoid reading a closed channel rather than assuming any receive implies a published message.
Useful? React with 👍 / 👎.
This submission adds a comprehensive suite of tests for the reverse shell functionality, including unit tests for the stream package and a new end-to-end test that validates the entire communication flow from WebSocket to gRPC. It also includes a new "Reverse Shell Architecture" section in the developer guide and several bug fixes identified during testing.
PR created automatically by Jules for task 13001055127057653994