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 4242 "@fortawesome/free-regular-svg-icons" : " ^5.12.1" ,
4343 "@fortawesome/free-solid-svg-icons" : " ^5.12.1" ,
4444 "@fortawesome/react-fontawesome" : " ^0.1.8" ,
45- "@httptoolkit/accounts" : " ^2.2 .0" ,
45+ "@httptoolkit/accounts" : " ^2.3 .0" ,
4646 "@httptoolkit/httpsnippet" : " ^2.1.7" ,
4747 "@open-rpc/meta-schema" : " ^1.14.2" ,
4848 "@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) {
6565 } ) ;
6666}
6767
68- export function logErrorsAsUser ( email : string | undefined ) {
68+ export function logErrorsAsUser ( id : string | undefined ) {
6969 if ( ! sentryInitialized ) return ;
7070
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+ }
7580}
7681
7782function addErrorTag ( key : string , value : string ) {
Original file line number Diff line number Diff line change @@ -129,9 +129,9 @@ export class AccountStore {
129129 this . user = yield getLatestUserData ( ) ;
130130 this . accountDataLastUpdated = Date . now ( ) ;
131131
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.
133133 // Useful generally, but especially for checkout/subscription issues.
134- logErrorsAsUser ( this . user . email ) ;
134+ logErrorsAsUser ( this . user . userId ) ;
135135
136136 if ( this . user . banned ) {
137137 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