René's URL Explorer Experiment


Title: gql: execute() leaves its event processor on the isolation scope, so later unrelated errors are reported as GraphQL requests · Issue #8262 · getsentry/sentry-python · GitHub

Open Graph Title: gql: execute() leaves its event processor on the isolation scope, so later unrelated errors are reported as GraphQL requests · Issue #8262 · getsentry/sentry-python

X Title: gql: execute() leaves its event processor on the isolation scope, so later unrelated errors are reported as GraphQL requests · Issue #8262 · getsentry/sentry-python

Description: How do you use Sentry? Sentry Saas (sentry.io) Version master (860a060), gql 4.4.0 Steps to Reproduce sentry_patched_execute adds an event processor to the isolation scope on every Client.execute() and never removes it: scope = sentry_sd...

Open Graph Description: How do you use Sentry? Sentry Saas (sentry.io) Version master (860a060), gql 4.4.0 Steps to Reproduce sentry_patched_execute adds an event processor to the isolation scope on every Client.execute()...

X Description: How do you use Sentry? Sentry Saas (sentry.io) Version master (860a060), gql 4.4.0 Steps to Reproduce sentry_patched_execute adds an event processor to the isolation scope on every Client.execute()...

Opengraph URL: https://github.com/getsentry/sentry-python/issues/8262

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"gql: execute() leaves its event processor on the isolation scope, so later unrelated errors are reported as GraphQL requests","articleBody":"### How do you use Sentry?\n\nSentry Saas (sentry.io)\n\n### Version\n\nmaster (860a060), gql 4.4.0\n\n### Steps to Reproduce\n\n`sentry_patched_execute` adds an event processor to the isolation scope on every `Client.execute()` and never removes it:\n\n```python\nscope = sentry_sdk.get_isolation_scope()\nscope.add_event_processor(_make_gql_event_processor(self, document))\n```\n\ngql is a client, so it's often called outside a per-request isolation scope (scripts, workers, task loops), or many times inside one request. The processors outlive the query and apply to every later event on that scope.\n\n```python\nimport sentry_sdk\nfrom gql import Client, gql\nfrom gql.transport.requests import RequestsHTTPTransport\nfrom sentry_sdk.integrations.gql import GQLIntegration\n\nsentry_sdk.init(dsn=..., integrations=[GQLIntegration()], send_default_pii=True)\nclient = Client(transport=RequestsHTTPTransport(url=\"http://example.com/graphql\"))\n\nfor i in range(100):\n    client.execute(gql(\"query Q%d { example }\" % i))  # all succeed\n\n# later, unrelated to GraphQL\ntry:\n    raise ValueError(\"unrelated error\")\nexcept ValueError:\n    sentry_sdk.capture_exception()\n```\n\nFull repro (HTTP mocked with `responses`, events captured from a custom transport): https://github.com/Mohil-Ahuja/ci-scratch/blob/main/repro/gql_processors.py, run output: https://github.com/Mohil-Ahuja/ci-scratch/actions/runs/42837565235\n\n### Expected Result\n\nThe unrelated `ValueError` has no GraphQL request data, and `contexts.response.type` is `\"response\"` on gql error events.\n\n### Actual Result\n\n1. **Unrelated errors are tagged as GraphQL requests.** The `ValueError` above is sent with the last query attached:\n\n   ```json\n   \"request\": {\"api_target\": \"graphql\", \"method\": \"POST\", \"url\": \"http://example.com/graphql\",\n               \"data\": {\"query\": \"query Q99 {\\n  example\\n}\", \"variables\": null, \"operationName\": \"Q99\"}}\n   ```\n\n2. **Other processors on the scope get wiped.** Once a scope has more than 20 processors, `Scope.add_event_processor` clears all of them. So 21 gql calls in one request remove processors added by the app or other integrations. In the repro, a processor added to the same isolation scope before 21 queries is gone afterwards, and the next error event is missing its tag.\n\n3. **`contexts.response.type` is a self-reference.** Both branches of the processor do `response.update({\"data\": ..., \"type\": response})`, which sets `type` to the dict itself, so it's serialized as `\"\u003ccyclic>\"`:\n\n   ```json\n   \"response\": {\"data\": {\"errors\": [{\"message\": \"boom\"}]}, \"type\": \"\u003ccyclic>\"}\n   ```\n\nPossible fix: fork a scope around `real_execute` (`with sentry_sdk.new_scope() as scope:`) and add the processor there, so it only applies to events captured during the query (including the `TransportQueryError` event), and set `\"type\": \"response\"`. Happy to open a PR with tests.\n","author":{"url":"https://github.com/Mohil-Ahuja","@type":"Person","name":"Mohil-Ahuja"},"datePublished":"2026-11-12T13:08:44Z","url":"https://github.com/getsentry/sentry-python/issues/8262"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:985b82a4-fa7c-48d7-bf2b-f64ee2906d3a
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idD132:428E1:2A7E54:388B12:6B009D55
html-safe-nonce97676f68079ea7cb64181c14c778bfc46647f2e152a800cfd611ffc76943094b
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMTMyOjQyOEUxOjJBN0U1NDozODhCMTI6NkIwMDlENTUiLCJ2aXNpdG9yX2lkIjoiNjY3NTU1NTMwNTAzMzYwNDQzOCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac6cf35af7fcb2ee50054068407555a80a35495f2fa4c106cfac05bc73c1053606
hovercard-subject-tagissue:6350485245
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/getsentry/sentry-python/8262/issue_layout
twitter:imagehttps://opengraph.githubassets.com/e8411f0111a02091325cfc8c02d687a49f5a8ad01de524932ce7baa307e6458c/getsentry/sentry-python/issues/8262
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/e8411f0111a02091325cfc8c02d687a49f5a8ad01de524932ce7baa307e6458c/getsentry/sentry-python/issues/8262
og:image:altHow do you use Sentry? Sentry Saas (sentry.io) Version master (860a060), gql 4.4.0 Steps to Reproduce sentry_patched_execute adds an event processor to the isolation scope on every Client.execute()...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameMohil-Ahuja
hostnamegithub.com
expected-hostnamegithub.com
None52c95ce7e48016ae14399656b4ee812462b6f1fa28c5008c8394da64794c00b8
turbo-cache-controlno-preview
go-importgithub.com/getsentry/sentry-python git https://github.com/getsentry/sentry-python.git
octolytics-dimension-user_id1396951
octolytics-dimension-user_logingetsentry
octolytics-dimension-repository_id137814779
octolytics-dimension-repository_nwogetsentry/sentry-python
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id137814779
octolytics-dimension-repository_network_root_nwogetsentry/sentry-python
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release1c9ddec8215f9a94e295c8310c3579b9c54ba31a
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/getsentry/sentry-python/issues/8262#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgetsentry%2Fsentry-python%2Fissues%2F8262
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgetsentry%2Fsentry-python%2Fissues%2F8262
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=getsentry%2Fsentry-python
Reloadhttps://github.com/getsentry/sentry-python/issues/8262
Reloadhttps://github.com/getsentry/sentry-python/issues/8262
Reloadhttps://github.com/getsentry/sentry-python/issues/8262
getsentryhttps://github.com/getsentry
sentry-pythonhttps://github.com/getsentry/sentry-python
Codehttps://github.com/getsentry/sentry-python
Issues345 (345)https://github.com/getsentry/sentry-python/issues
Pull requests41 (41)https://github.com/getsentry/sentry-python/pulls
Discussionshttps://github.com/getsentry/sentry-python/discussions
Actionshttps://github.com/getsentry/sentry-python/actions
Security and quality2 (2)https://github.com/getsentry/sentry-python/security
Insightshttps://github.com/getsentry/sentry-python/insights
https://github.com/getsentry/sentry-python
New issuehttps://github.com/login?return_to=https://github.com/getsentry/sentry-python/issues/8262
New issuehttps://github.com/login?return_to=https://github.com/getsentry/sentry-python/issues/8262
#8307https://github.com/getsentry/sentry-python/pull/8307
gql: execute() leaves its event processor on the isolation scope, so later unrelated errors are reported as GraphQL requestshttps://github.com/getsentry/sentry-python/issues/8262#top
#8307https://github.com/getsentry/sentry-python/pull/8307
https://github.com/sentrivana
Bughttps://github.com/getsentry/sentry-python/issues?q=state%3Aopen%20label%3A%22Bug%22
https://github.com/Mohil-Ahuja
Mohil-Ahujahttps://github.com/Mohil-Ahuja
on Nov 12, 2026https://github.com/getsentry/sentry-python/issues/8262#issue-6350485245
860a060https://github.com/getsentry/sentry-python/commit/860a0600f3c27934362229176e1c722d94faf4d6
https://github.com/Mohil-Ahuja/ci-scratch/blob/main/repro/gql_processors.pyhttps://github.com/Mohil-Ahuja/ci-scratch/blob/main/repro/gql_processors.py
https://github.com/Mohil-Ahuja/ci-scratch/actions/runs/42837565235https://github.com/Mohil-Ahuja/ci-scratch/actions/runs/42837565235
getsantryhttps://github.com/apps/getsantry
Waiting for: Product Ownerhttps://github.com/getsentry/sentry-python/issues?q=state%3Aopen%20label%3A%22Waiting%20for%3A%20Product%20Owner%22
on Nov 12, 2026https://github.com/getsentry/sentry-python/issues/8262#event-35914866385
https://github.com/apps/linear-code
linear-codehttps://github.com/apps/linear-code
on Nov 12, 2026https://github.com/getsentry/sentry-python/issues/8262#issuecomment-6824488301
Linear Codehttps://linear.app
PY-3075https://linear.app/getsentry/issue/PY-3075
getsantryhttps://github.com/apps/getsantry
GitHub Issues with 👀 3https://github.com/orgs/getsentry/projects/227
on Nov 12, 2026https://github.com/getsentry/sentry-python/issues/8262#event-35914872514
getsantryhttps://github.com/apps/getsantry
GitHub Issues with 👀 3https://github.com/orgs/getsentry/projects/227
on Nov 12, 2026https://github.com/getsentry/sentry-python/issues/8262
linear-codehttps://github.com/apps/linear-code
Bughttps://github.com/getsentry/sentry-python/issues?q=state%3Aopen%20label%3A%22Bug%22
on Nov 12, 2026https://github.com/getsentry/sentry-python/issues/8262#event-35914914002
sentrivanahttps://github.com/sentrivana
Waiting for: Product Ownerhttps://github.com/getsentry/sentry-python/issues?q=state%3Aopen%20label%3A%22Waiting%20for%3A%20Product%20Owner%22
on Nov 17, 2026https://github.com/getsentry/sentry-python/issues/8262#event-36389287942
getsantryhttps://github.com/apps/getsantry
GitHub Issues with 👀 3https://github.com/orgs/getsentry/projects/227
on Nov 17, 2026https://github.com/getsentry/sentry-python/issues/8262
https://github.com/sentrivana
sentrivanahttps://github.com/sentrivana
on Nov 17, 2026https://github.com/getsentry/sentry-python/issues/8262#issuecomment-6944709734
@Mohil-Ahujahttps://github.com/Mohil-Ahuja
https://github.com/mohanprasath-dev
mohanprasath-devhttps://github.com/mohanprasath-dev
on Nov 17, 2026https://github.com/getsentry/sentry-python/issues/8262#issuecomment-6945637227
@Mohil-Ahujahttps://github.com/Mohil-Ahuja
@sentrivanahttps://github.com/sentrivana
getsantryhttps://github.com/apps/getsantry
Waiting for: Product Ownerhttps://github.com/getsentry/sentry-python/issues?q=state%3Aopen%20label%3A%22Waiting%20for%3A%20Product%20Owner%22
on Nov 17, 2026https://github.com/getsentry/sentry-python/issues/8262#event-36393244486
getsantryhttps://github.com/apps/getsantry
GitHub Issues with 👀 3https://github.com/orgs/getsentry/projects/227
on Nov 17, 2026https://github.com/getsentry/sentry-python/issues/8262
https://github.com/Mohil-Ahuja
Mohil-Ahujahttps://github.com/Mohil-Ahuja
on Nov 17, 2026https://github.com/getsentry/sentry-python/issues/8262#issuecomment-6956593320
@mohanprasath-devhttps://github.com/mohanprasath-dev
#8307https://github.com/getsentry/sentry-python/pull/8307
sentrivanahttps://github.com/sentrivana
Waiting for: Product Ownerhttps://github.com/getsentry/sentry-python/issues?q=state%3Aopen%20label%3A%22Waiting%20for%3A%20Product%20Owner%22
on Nov 18, 2026https://github.com/getsentry/sentry-python/issues/8262#event-36515933703
getsantryhttps://github.com/apps/getsantry
GitHub Issues with 👀 3https://github.com/orgs/getsentry/projects/227
on Nov 18, 2026https://github.com/getsentry/sentry-python/issues/8262
sentrivanahttps://github.com/sentrivana
on Nov 18, 2026https://github.com/getsentry/sentry-python/issues/8262#event-36515944339
sentrivanahttps://github.com/sentrivana
completedhttps://github.com/getsentry/sentry-python/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#8307https://github.com/getsentry/sentry-python/pull/8307
on Nov 18, 2026https://github.com/getsentry/sentry-python/issues/8262#event-36516875845
sentrivanahttps://github.com/sentrivana
on Nov 18, 2026https://github.com/getsentry/sentry-python/issues/8262#event-36526439985
fix(gql): Scope the event processor to the query (getsentry#8307)https://github.com/ratomirjovanovic/sentry-python/commit/e607c3d1a55352da4b12a9478c8f4b14845c0562
getsentry#8307https://github.com/getsentry/sentry-python/pull/8307
https://docs.github.com/articles/closing-issues-via-commit-messages
e607c3dhttps://github.com/ratomirjovanovic/sentry-python/commit/e607c3d1a55352da4b12a9478c8f4b14845c0562
Sign up for freehttps://github.com/signup?return_to=https://github.com/getsentry/sentry-python/issues/8262
Sign in to commenthttps://github.com/login?return_to=https://github.com/getsentry/sentry-python/issues/8262
sentrivanahttps://github.com/sentrivana
Bughttps://github.com/getsentry/sentry-python/issues?q=state%3Aopen%20label%3A%22Bug%22
GitHub Issues with 👀 3https://github.com/orgs/getsentry/projects/227
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.