-
-
Notifications
You must be signed in to change notification settings - Fork 330
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
fix: Invalid context on GraphQL request errors #4567
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -456,8 +456,9 @@ - (void)captureFailedRequests:(NSURLSessionTask *)sessionTask | |||||||||||||||
context[@"response"] = response; | ||||||||||||||||
|
||||||||||||||||
if (self.isGraphQLOperationTrackingEnabled) { | ||||||||||||||||
context[@"graphql_operation_name"] = | ||||||||||||||||
[URLSessionTaskHelper getGraphQLOperationNameFrom:sessionTask]; | ||||||||||||||||
NSMutableDictionary<NSString *, id> *graphql = [[NSMutableDictionary alloc] init]; | ||||||||||||||||
context[@"graphql"] = graphql; | ||||||||||||||||
graphql[@"operation_name"] = [URLSessionTaskHelper getGraphQLOperationNameFrom:sessionTask]; | ||||||||||||||||
Comment on lines
+460
to
+461
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure if there's anything special needed to get prettier names in the Sentry dashboard, or if that's necessary. Here's how this looks in a test event I generated with our app:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We have to do that on the backend, not in the SDK.
Comment on lines
+459
to
+461
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. With the following approach, we avoid allocating a mutable dict which could reserve some unrequired capacity.
Suggested change
|
||||||||||||||||
} | ||||||||||||||||
|
||||||||||||||||
event.context = context; | ||||||||||||||||
|
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.
Following instructions from
check-tooling-versions.sh
:Let me know if you don't want this change in this PR, but it was preventing me from committing with the pre-commit hook in place.
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.
I opened an extra PR for this: #4573.