-
-
Notifications
You must be signed in to change notification settings - Fork 227
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ref(dif): Genericize
try_assemble
options
parameter
Introduce new `ChunkOptions` trait which defines an interface for types that store chunk uploading options, and use this trait for the `try_assemble` function's `options` parameter. This change is needed to enable Proguard chunk uploads to use the `try_assemble` function, since Proguard uploads will not be able to use the existing `DifUpload` struct to configure upload options. Refactoring the `DifUpload` struct to also support Proguard uploads would be more complex than having a separate struct for storing Proguard upload options, and having both the `DifUpload` and the Proguard upload struct implement `ChunkOptions`. In the future, we might consider refactoring so that we have one struct that can store upload options for any kind of upload.
- Loading branch information
1 parent
edabdef
commit f835979
Showing
3 changed files
with
37 additions
and
7 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/// A trait representing options for chunk uploads. | ||
pub trait ChunkOptions { | ||
/// Determines whether we need to strip debug_ids from the requests. | ||
/// When this function returns `true`, the caller is responsible for stripping | ||
/// the debug_ids from the requests, to maintain backwards compatibility with | ||
/// older Sentry servers. | ||
fn should_strip_debug_ids(&self) -> bool; | ||
|
||
/// Returns the organization that we are uploading to. | ||
fn org(&self) -> &str; | ||
|
||
/// Returns the project that we are uploading to. | ||
fn project(&self) -> &str; | ||
} |
This file contains 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