File tree Expand file tree Collapse file tree 4 files changed +21
-15
lines changed Expand file tree Collapse file tree 4 files changed +21
-15
lines changed Original file line number Diff line number Diff line change 42
42
"@fortawesome/free-regular-svg-icons" : " ^5.12.1" ,
43
43
"@fortawesome/free-solid-svg-icons" : " ^5.12.1" ,
44
44
"@fortawesome/react-fontawesome" : " ^0.1.8" ,
45
- "@httptoolkit/accounts" : " ^2.2 .0" ,
45
+ "@httptoolkit/accounts" : " ^2.3 .0" ,
46
46
"@httptoolkit/httpsnippet" : " ^2.1.7" ,
47
47
"@open-rpc/meta-schema" : " ^1.14.2" ,
48
48
"@phosphor-icons/react" : " ^2.1.5" ,
Original file line number Diff line number Diff line change @@ -65,13 +65,18 @@ export function initSentry(dsn: string | undefined) {
65
65
} ) ;
66
66
}
67
67
68
- export function logErrorsAsUser ( email : string | undefined ) {
68
+ export function logErrorsAsUser ( id : string | undefined ) {
69
69
if ( ! sentryInitialized ) return ;
70
70
71
- Sentry . getCurrentScope ( ) . setUser ( {
72
- id : email ,
73
- email : email
74
- } ) ;
71
+ if ( ! id ) {
72
+ Sentry . getCurrentScope ( ) . setUser ( null ) ;
73
+ } else {
74
+ // We track errors by user id - this ensures that any actual identities are
75
+ // never exposed to Sentry (you need access to our user DB to link user error
76
+ // reports and the corresponding Sentry data).
77
+ id = id . replace ( 'email|' , '' ) ;
78
+ Sentry . getCurrentScope ( ) . setUser ( { id : id } ) ;
79
+ }
75
80
}
76
81
77
82
function addErrorTag ( key : string , value : string ) {
Original file line number Diff line number Diff line change @@ -129,9 +129,9 @@ export class AccountStore {
129
129
this . user = yield getLatestUserData ( ) ;
130
130
this . accountDataLastUpdated = Date . now ( ) ;
131
131
132
- // Include the user email in error reports whilst they're logged in.
132
+ // Include the user id in error reports whilst they're logged in.
133
133
// Useful generally, but especially for checkout/subscription issues.
134
- logErrorsAsUser ( this . user . email ) ;
134
+ logErrorsAsUser ( this . user . userId ) ;
135
135
136
136
if ( this . user . banned ) {
137
137
alert ( 'Your account has been blocked for abuse. Please contact help@httptoolkit.com.' ) ;
You can’t perform that action at this time.
0 commit comments