feat(transport): Introduce structs for transport options#1142
Open
szokeasaurusrex wants to merge 2 commits into
Open
feat(transport): Introduce structs for transport options#1142szokeasaurusrex wants to merge 2 commits into
szokeasaurusrex wants to merge 2 commits into
Conversation
7872da8 to
131cae7
Compare
ff22f25 to
33ff8e6
Compare
131cae7 to
91aa345
Compare
33ff8e6 to
6d1cc97
Compare
15eeea4 to
ffbee4e
Compare
|
ffbee4e to
ac9351c
Compare
szokeasaurusrex
commented
Jun 9, 2026
szokeasaurusrex
commented
Jun 9, 2026
Comment on lines
+43
to
+45
| /// ### Panics | ||
| /// | ||
| /// Panics if called with `options` that lack a DSN. |
Member
Author
There was a problem hiding this comment.
This panic is not new. It was previously undocumented.
9e08f3a to
f8521cc
Compare
93f2d23 to
1fca0c6
Compare
193723f to
87946bc
Compare
This will allow us to add additional construction options, either to all transports or to individual transports, in the future without breaking the public API. This will be useful in #1004, as we will need to provide transports with a handle to record data losses. For users who use a custom transport/transport factory, this change may produce a minor behavior breakage, as the `&ClientOptions` received by the `create_transport` method (or the closure, in the case of transport factories which are just closures) will no longer contain all of the options set when init-ing the SDK, only those options which are also present in `TransportOptions`. As the API remains fully compatible, however, we are not considering this to be a public API breakage, and will release these changes in a minor/patch release. References [#1004](#1004) References [RUST-156](https://linear.app/getsentry/issue/RUST-156/record-transport-drops-and-attach-client-report-envelopes) Fixes [#1157](#1157) Fixes [RUST-232](https://linear.app/getsentry/issue/RUST-232)
87946bc to
f0916b0
Compare
c4091ca to
f9b553c
Compare
lcian
reviewed
Jun 12, 2026
| #[derive(Debug)] | ||
| #[must_use] | ||
| #[non_exhaustive] | ||
| pub struct TransportOptions { |
Member
There was a problem hiding this comment.
Maybe there's a way to avoid the behavioral breakage by optionally storing the ClientOptions here if the transport was created via ClientOptions (or maybe not). Either way I think the breakage is really minimal, unlikely to affect any users.
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.
This will allow us to add additional construction options, either to all transports or to individual transports, in the future without breaking the public API. This will be useful in #1004, as we will need to provide transports with a handle to record data losses.
For users who use a custom transport/transport factory, this change may produce a minor behavior breakage, as the
&ClientOptionsreceived by thecreate_transportmethod (or the closure, in the case of transport factories which are just closures) will no longer contain all of the options set when init-ing the SDK, only those options which are also present inTransportOptions. As the API remains fully compatible, however, we are not considering this to be a public API breakage, and will release these changes in a minor/patch release.References #1004
References RUST-156
Fixes #1157
Fixes RUST-232