File tree 4 files changed +19
-1
lines changed 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 }
35
35
log = { version = " 0.4" , optional = true }
36
36
serde = " 1.0"
37
37
serde_json = " 1.0"
38
- sentry-types = " 0.3.0 "
38
+ sentry-types = " 0.3.1 "
39
39
reqwest = { version = " 0.8.5" , optional = true }
40
40
uuid = { version = " 0.6.2" , features = [" v4" ] }
41
41
lazy_static = " 1.0.0"
Original file line number Diff line number Diff line change @@ -278,6 +278,12 @@ impl Client {
278
278
) ;
279
279
}
280
280
281
+ if event. transaction . is_none ( ) {
282
+ if let Some ( ref txn) = scope. transaction {
283
+ event. transaction = Some ( ( * * txn) . clone ( ) ) ;
284
+ }
285
+ }
286
+
281
287
if event. fingerprint . len ( ) == 1
282
288
&& ( event. fingerprint [ 0 ] == "{{ default }}"
283
289
|| event. fingerprint [ 0 ] == "{{default}}" )
Original file line number Diff line number Diff line change @@ -72,6 +72,11 @@ impl Scope {
72
72
shim_unreachable ! ( ) ;
73
73
}
74
74
75
+ pub fn set_transaction ( & mut self , transaction : Option < & str > ) {
76
+ let _transaction = transaction;
77
+ shim_unreachable ! ( ) ;
78
+ }
79
+
75
80
pub fn set_user ( & mut self , user : Option < User > ) {
76
81
let _user = user;
77
82
shim_unreachable ! ( ) ;
Original file line number Diff line number Diff line change @@ -56,6 +56,7 @@ pub(crate) fn scope_panic_safe() -> bool {
56
56
#[ derive( Debug , Clone ) ]
57
57
pub struct Scope {
58
58
pub ( crate ) fingerprint : Option < Arc < Vec < Cow < ' static , str > > > > ,
59
+ pub ( crate ) transaction : Option < Arc < String > > ,
59
60
pub ( crate ) breadcrumbs : im:: Vector < Breadcrumb > ,
60
61
pub ( crate ) user : Option < Arc < User > > ,
61
62
pub ( crate ) extra : im:: HashMap < String , Value > ,
@@ -66,6 +67,7 @@ pub struct Scope {
66
67
fn default_scope ( ) -> Scope {
67
68
Scope {
68
69
fingerprint : None ,
70
+ transaction : None ,
69
71
breadcrumbs : Default :: default ( ) ,
70
72
user : None ,
71
73
extra : Default :: default ( ) ,
@@ -322,6 +324,11 @@ impl Scope {
322
324
fingerprint. map ( |fp| Arc :: new ( fp. iter ( ) . map ( |x| Cow :: Owned ( x. to_string ( ) ) ) . collect ( ) ) )
323
325
}
324
326
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
+
325
332
/// Sets the user for the current scope.
326
333
pub fn set_user ( & mut self , user : Option < User > ) {
327
334
self . user = user. map ( Arc :: new) ;
You can’t perform that action at this time.
0 commit comments