File tree Expand file tree Collapse file tree 4 files changed +19
-1
lines changed Expand file tree Collapse file tree 4 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ failure = { version = "0.1", optional = true }
3535log = { version = " 0.4" , optional = true }
3636serde = " 1.0"
3737serde_json = " 1.0"
38- sentry-types = " 0.3.0 "
38+ sentry-types = " 0.3.1 "
3939reqwest = { version = " 0.8.5" , optional = true }
4040uuid = { version = " 0.6.2" , features = [" v4" ] }
4141lazy_static = " 1.0.0"
Original file line number Diff line number Diff line change @@ -278,6 +278,12 @@ impl Client {
278278 ) ;
279279 }
280280
281+ if event. transaction . is_none ( ) {
282+ if let Some ( ref txn) = scope. transaction {
283+ event. transaction = Some ( ( * * txn) . clone ( ) ) ;
284+ }
285+ }
286+
281287 if event. fingerprint . len ( ) == 1
282288 && ( event. fingerprint [ 0 ] == "{{ default }}"
283289 || event. fingerprint [ 0 ] == "{{default}}" )
Original file line number Diff line number Diff line change @@ -72,6 +72,11 @@ impl Scope {
7272 shim_unreachable ! ( ) ;
7373 }
7474
75+ pub fn set_transaction ( & mut self , transaction : Option < & str > ) {
76+ let _transaction = transaction;
77+ shim_unreachable ! ( ) ;
78+ }
79+
7580 pub fn set_user ( & mut self , user : Option < User > ) {
7681 let _user = user;
7782 shim_unreachable ! ( ) ;
Original file line number Diff line number Diff line change @@ -56,6 +56,7 @@ pub(crate) fn scope_panic_safe() -> bool {
5656#[ derive( Debug , Clone ) ]
5757pub struct Scope {
5858 pub ( crate ) fingerprint : Option < Arc < Vec < Cow < ' static , str > > > > ,
59+ pub ( crate ) transaction : Option < Arc < String > > ,
5960 pub ( crate ) breadcrumbs : im:: Vector < Breadcrumb > ,
6061 pub ( crate ) user : Option < Arc < User > > ,
6162 pub ( crate ) extra : im:: HashMap < String , Value > ,
@@ -66,6 +67,7 @@ pub struct Scope {
6667fn default_scope ( ) -> Scope {
6768 Scope {
6869 fingerprint : None ,
70+ transaction : None ,
6971 breadcrumbs : Default :: default ( ) ,
7072 user : None ,
7173 extra : Default :: default ( ) ,
@@ -322,6 +324,11 @@ impl Scope {
322324 fingerprint. map ( |fp| Arc :: new ( fp. iter ( ) . map ( |x| Cow :: Owned ( x. to_string ( ) ) ) . collect ( ) ) )
323325 }
324326
327+ /// Sets the transaction.
328+ pub fn set_transaction ( & mut self , transaction : Option < & str > ) {
329+ self . transaction = transaction. map ( |txn| Arc :: new ( txn. to_string ( ) ) ) ;
330+ }
331+
325332 /// Sets the user for the current scope.
326333 pub fn set_user ( & mut self , user : Option < User > ) {
327334 self . user = user. map ( Arc :: new) ;
You can’t perform that action at this time.
0 commit comments