ref(client): Create EnvelopeSender to wrap Transport#1139
Open
szokeasaurusrex wants to merge 2 commits into
Open
ref(client): Create EnvelopeSender to wrap Transport#1139szokeasaurusrex wants to merge 2 commits into
EnvelopeSender to wrap Transport#1139szokeasaurusrex wants to merge 2 commits into
Conversation
52f0b7a to
9104579
Compare
9104579 to
863a5b5
Compare
szokeasaurusrex
added a commit
that referenced
this pull request
Jun 8, 2026
Move `batcher` under `client`, as it is only used in the `client`. Follow up to #1139, and stacked on that PR.
863a5b5 to
1df01c0
Compare
szokeasaurusrex
added a commit
that referenced
this pull request
Jun 8, 2026
Move `batcher` under `client`, as it is only used in the `client`. Follow up to #1139, and stacked on that PR.
1df01c0 to
b2f3e71
Compare
szokeasaurusrex
added a commit
that referenced
this pull request
Jun 9, 2026
Move `batcher` under `client`, as it is only used in the `client`. Follow up to #1139, and stacked on that PR.
b2f3e71 to
cef2e11
Compare
szokeasaurusrex
added a commit
that referenced
this pull request
Jun 9, 2026
Move `batcher` under `client`, as it is only used in the `client`. Follow up to #1139, and stacked on that PR.
Member
Author
|
@lcian This is ready for review. I ended up changing the In the PR which implements #1004, I'll use the callback to provide the transport constructors with the handle the transport will need to use to record losses. |
lcian
reviewed
Jun 9, 2026
This was referenced Jun 10, 2026
Create a new `EnvelopeSender` type, which wraps the client's transport. `EnvelopeSender` is itself a lightweight wrapper around a `TransportSlot`, which itself is a replacement for `TransportArc` and was also introduced in this change. The `TransportSlot` abstracts the logic for managing whether the transport is present or not, while the `EnvelopeSender` abstracts away the whole transport itself. **Why the change?** Previously, code in several different places (the client, the batchers, and the session flusher) interacted with the transport directly. This makes it difficult for us to ensure that any preprocessing we want to do on all envelopes before they go to the transport happens in all the places we use the transport. With this change, we can perform any needed preprocessing in the `EnvelopeSender`'s `send_envelope` implementation. We intend to use this for sending client reports; we will check in `EnvelopeSender`'s `send_envelope` whether there are any pending reports, and attach them to the outgoing envelope if yes. Contributes to [#1002](#1002) Contributes to [RUST-154](https://linear.app/getsentry/issue/RUST-154/add-shared-client-report-aggregator-and-send-client-reports-option) Closes [#1155](#1155) Closes [RUST-230](https://linear.app/getsentry/issue/RUST-230)
cef2e11 to
587fe93
Compare
szokeasaurusrex
added a commit
that referenced
this pull request
Jun 10, 2026
Move `batcher` under `client`, as it is only used in the `client`. Follow up to #1139, and stacked on that PR. Closes [#1156](#1156) Closes [RUST-231](https://linear.app/getsentry/issue/RUST-231)
lcian
approved these changes
Jun 10, 2026
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.
Create a new
EnvelopeSendertype, which wraps the client's transport.EnvelopeSenderis itself a lightweight wrapper around aTransportSlot, which itself is a replacement forTransportArcand was also introduced in this change. TheTransportSlotabstracts the logic for managing whether the transport is present or not, while theEnvelopeSenderabstracts away the whole transport itself.Why the change? Previously, code in several different places (the client, the batchers, and the session flusher) interacted with the transport directly. This makes it difficult for us to ensure that any preprocessing we want to do on all envelopes before they go to the transport happens in all the places we use the transport.
With this change, we can perform any needed preprocessing in the
EnvelopeSender'ssend_envelopeimplementation. We intend to use this for sending client reports; we will check inEnvelopeSender'ssend_envelopewhether there are any pending reports, and attach them to the outgoing envelope if yes.Contributes to #1002
Contributes to RUST-154
Closes #1155
Closes RUST-230