- 
                Notifications
    
You must be signed in to change notification settings  - Fork 11
 
Feat: Set user context #23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Changes primarily reflect setting user context early in App.tsx. Additionally this context is added to outgoing GET and POST requests from scope to transfer user context to connected services.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approve but if you could answer the questions for my knowledge please
| placeholder={item.placeholder} | ||
| onPressIn={() => { | ||
| dispatch({ type: 'FILL_FIELDS', payload: 'dummydata' })} | ||
| dispatch({ type: 'FILL_FIELDS', payload: 'dummydata', onScope:email ? email:null})} | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dgbailey this onScope stuff works great. Wondering, is this a property or part of the redux or React Context API? Or is it more like a property you're declaring and it simply gets passed through.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @thinkocapo just declaring it myself so it gets passed.
| setProductData(null); | ||
| let se, customerType, email; | ||
| Sentry.withScope(function(scope) { | ||
| [ se, customerType ] = [scope._tags.se, scope._tags.customerType ] | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dgbailey what was the workaround for letting you take _tags data off of the scope? Wasn't it preventing you at first?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@thinkocapo Turns out the compiler will warn about what is deemed inappropriate use of a protected field but do nothing to prevent it at runtime.
| 
           @dgbailey I saw all the backend transactions + errors (Flask) had the user email set as well. We have a different todo open for some user info missing on Springboot or Express transactions, but someone is already on it. That's a backend problem. Now the frontend looks solid. 👍 merge it  | 
    
Changes primarily reflect setting user context early in App.tsx. Additionally this context is added to outgoing GET and POST requests from scope to transfer user context to connected services.
Example Transactions:
https://sentry.io/organizations/testorg-az/discover/results/?field=transaction&field=user.email&field=count%28%29&name=Transactions+by+Volume&query=project%3Areact-native+has%3Auser.email+event.type%3Atransaction&sort=-count&statsPeriod=7d&yAxis=count%28%29