René's URL Explorer Experiment


Title: [@sentry/angular - @sentry/browser] Setting context data (tags, extra or context) for errors/exceptions is not working in an async context · Issue #5417 · getsentry/sentry-javascript · GitHub

Open Graph Title: [@sentry/angular - @sentry/browser] Setting context data (tags, extra or context) for errors/exceptions is not working in an async context · Issue #5417 · getsentry/sentry-javascript

X Title: [@sentry/angular - @sentry/browser] Setting context data (tags, extra or context) for errors/exceptions is not working in an async context · Issue #5417 · getsentry/sentry-javascript

Description: Official Sentry SDKs for JavaScript. Contribute to getsentry/sentry-javascript development by creating an account on GitHub.

Open Graph Description: Official Sentry SDKs for JavaScript. Contribute to getsentry/sentry-javascript development by creating an account on GitHub.

X Description: Official Sentry SDKs for JavaScript. Contribute to getsentry/sentry-javascript development by creating an account on GitHub.

Opengraph URL: https://github.com/getsentry/sentry-javascript

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.114.4


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[@sentry/angular - @sentry/browser] Setting context data (tags, extra or context) for errors/exceptions is not working in an async context","articleBody":"### Is there an existing issue for this?\r\n\r\n- [X] I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues\r\n- [X] I have reviewed the documentation https://docs.sentry.io/\r\n- [X] I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases\r\n\r\n### How do you use Sentry?\r\n\r\nSentry Saas (sentry.io)\r\n\r\n### Which package are you using?\r\n\r\n@sentry/angular\r\n\r\n### SDK Version\r\n\r\n7.6.0\r\n\r\n### Framework Version\r\n\r\n14.0.0\r\n\r\n### Link to Sentry event\r\n\r\n_No response_\r\n\r\n### Steps to Reproduce\r\n\r\n\r\nHello,\r\n\r\nWe are facing some issues with the latest browser/angular SDK version (7.6.0) because the context data (tags, extra, etc), which we just set before capture the event by Sentry SDK,  don't appear in the Sentry dashboard along with the error. This problem just shows up when the error happens in an async context like:\r\n\r\n```\r\nsetTimeout(() => {\r\n   const c = null;\r\n   const v = c.pop;\r\n}, 1000)\r\n```\r\n\r\nHowever, if the error happens in a sync context, the error context data does appear in the Sentry dashboard as expected.\r\n\r\n\r\nIn order to set a specific context for an error we have unsuccessfully tried all ways that the documentation says here: https://docs.sentry.io/platforms/javascript/enriching-events/context/#passing-context-directly\r\n\r\nFor example like that:\r\n```\r\nSentry.withScope(scope => {\r\n  scope.setTag('customTag', 'error');\r\n  scope.setExtra('test', 'this is a test');\r\n  scope.setContext('test', { value: 'test context' });\r\n  Sentry.captureException(extractedError);\r\n});\r\n```\r\nOr like that: \r\n```\r\nSentry.captureException(error, {\r\n  tags: {\r\n    section: \"articles\",\r\n  },\r\n});\r\n```\r\n\r\nFor our surprise, this just happens in SDK version higher than 7.0, since we have also tried to do the same with the latest 6x SDK version and it is working property over it (all data is shown up in the Sentry dashboard as expected).\r\n\r\nPlease, is there some official workaround to deal with this issue?\r\n\r\nThanks in advance,\r\n\r\n\r\n\r\n### Expected Result\r\n\r\nSentry SDK should record tags, extra and context we set for the error captured by Sentry SDK and they also should be shown up in the Sentry dashboard.\r\n\r\n### Actual Result\r\n\r\nSentry SDK doesn't record properly the error tags and context data when the error happens in an async context. It seems that all data set in the error scope is lost.","author":{"url":"https://github.com/rpanadero","@type":"Person","name":"rpanadero"},"datePublished":"2022-07-13T12:09:34Z","url":"https://github.com/getsentry/sentry-javascript/issues/5417"}

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/:user_id/:repository/issues/:id(.:format)
route-controllerissues
route-actionshow
fetch-noncev2:97e5af8f-5a76-a786-f4df-ea7f5e262ed5
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idDF4E:42691:15A0B5:1DE4D9:6B04479E
html-safe-nonce400dee9e14817a42ac57a2674dc23f665d1bd6dc7af6f032e51c94e4c13bab38
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJERjRFOjQyNjkxOjE1QTBCNToxREU0RDk6NkIwNDQ3OUUiLCJ2aXNpdG9yX2lkIjoiODgxMjc0MDcxOTk0ODc3ODU0IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmacfd9edcd4c945ded3e24ce441e18b7e2f7417a134678fa049173819f1e1af5920
hovercard-subject-tagrepository:3328572
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///issues/show
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/getsentry/sentry-javascript/issues/5417
twitter:imagehttps://repository-images.githubusercontent.com/3328572/1b73c77d-6488-4ece-9e12-e61d9eb2ac2b
twitter:cardsummary_large_image
og:imagehttps://repository-images.githubusercontent.com/3328572/1b73c77d-6488-4ece-9e12-e61d9eb2ac2b
og:image:altOfficial Sentry SDKs for JavaScript. Contribute to getsentry/sentry-javascript development by creating an account on GitHub.
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Noned4495c3631faba668036f176d1f5946901c5172efd73a6edb984029e7d4f8e46
turbo-cache-controlno-cache
go-importgithub.com/getsentry/sentry-javascript git https://github.com/getsentry/sentry-javascript.git
octolytics-dimension-user_id1396951
octolytics-dimension-user_logingetsentry
octolytics-dimension-repository_id3328572
octolytics-dimension-repository_nwogetsentry/sentry-javascript
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id3328572
octolytics-dimension-repository_network_root_nwogetsentry/sentry-javascript
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
release9ac4337fb7c6a5846cdfdb1a04f154d3c33ebc77
ui-targetcanary-2
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/getsentry/sentry-javascript/issues/5417#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgetsentry%2Fsentry-javascript%2Fissues%2F5417
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-javascript%2Fissues%2F5417
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fissues%2Fshow&source=header-repo&source_repo=getsentry%2Fsentry-javascript
Reloadhttps://github.com/getsentry/sentry-javascript/issues/5417
Reloadhttps://github.com/getsentry/sentry-javascript/issues/5417
Reloadhttps://github.com/getsentry/sentry-javascript/issues/5417
https://github.com/getsentry/sentry-javascript
New issuehttps://github.com/login?return_to=https://github.com/getsentry/sentry-javascript/issues/5417
New issuehttps://github.com/login?return_to=https://github.com/getsentry/sentry-javascript/issues/5417
[@sentry/angular - @sentry/browser] Setting context data (tags, extra or context) for errors/exceptions is not working in an async contexthttps://github.com/getsentry/sentry-javascript/issues/5417#top
https://github.com/rpanadero
rpanaderohttps://github.com/rpanadero
on Jul 13, 2022https://github.com/getsentry/sentry-javascript/issues/5417#issue-1303344528
https://github.com/getsentry/sentry-javascript/issueshttps://github.com/getsentry/sentry-javascript/issues
https://docs.sentry.io/https://docs.sentry.io/
https://github.com/getsentry/sentry-javascript/releaseshttps://github.com/getsentry/sentry-javascript/releases
https://docs.sentry.io/platforms/javascript/enriching-events/context/#passing-context-directlyhttps://docs.sentry.io/platforms/javascript/enriching-events/context/#passing-context-directly
rpanaderohttps://github.com/rpanadero
Type: Bughttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Type%3A%20Bug%22
on Jul 13, 2022https://github.com/getsentry/sentry-javascript/issues/5417#event-6985425081
getsantryhttps://github.com/apps/getsantry
Status: Untriagedhttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Status%3A%20Untriaged%22
on Jul 13, 2022https://github.com/getsentry/sentry-javascript/issues/5417#event-6985425360
rpanaderohttps://github.com/rpanadero
on Jul 13, 2022https://github.com/getsentry/sentry-javascript/issues/5417#event-6985428091
Lms24https://github.com/Lms24
Status: Untriagedhttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Status%3A%20Untriaged%22
on Jul 13, 2022https://github.com/getsentry/sentry-javascript/issues/5417#event-6985876993
https://github.com/Lms24
Lms24https://github.com/Lms24
on Jul 13, 2022https://github.com/getsentry/sentry-javascript/issues/5417#issuecomment-1183254102
@rpanaderohttps://github.com/rpanadero
Lms24https://github.com/Lms24
Status: Needs Reproductionhttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Status%3A%20Needs%20Reproduction%22
on Jul 13, 2022https://github.com/getsentry/sentry-javascript/issues/5417#event-6986224251
https://github.com/rpanadero
rpanaderohttps://github.com/rpanadero
on Jul 13, 2022https://github.com/getsentry/sentry-javascript/issues/5417#issuecomment-1183304859
@Lms24https://github.com/Lms24
https://github.com/rpanadero/sentry-issue-5417https://github.com/rpanadero/sentry-issue-5417
https://sentry.io/share/issue/d16a069ce14f486a8aa757649d5060c3/https://sentry.io/share/issue/d16a069ce14f486a8aa757649d5060c3/
https://sentry.io/share/issue/ab36f92248f84eb89551f1ccc53b86b0/https://sentry.io/share/issue/ab36f92248f84eb89551f1ccc53b86b0/
Lms24https://github.com/Lms24
Package: angularhttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Package%3A%20angular%22
Status: Needs Reproductionhttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Status%3A%20Needs%20Reproduction%22
on Jul 14, 2022https://github.com/getsentry/sentry-javascript/issues/5417#event-6997233883
https://github.com/Lms24
Lms24https://github.com/Lms24
on Jul 15, 2022https://github.com/getsentry/sentry-javascript/issues/5417#issuecomment-1185465317
our docshttps://docs.sentry.io/platforms/javascript/guides/angular/#automatically-send-errors-with-errorhandler
hookhttps://docs.sentry.io/platforms/javascript/guides/angular/configuration/options/#hooks
ErrorHandlerhttps://github.com/getsentry/sentry-javascript/blob/a87c0c6cc3f5be42ba0c34403adc55932c2833d6/packages/angular/src/errorhandler.ts#L43
https://github.com/rpanadero
rpanaderohttps://github.com/rpanadero
on Jul 19, 2022https://github.com/getsentry/sentry-javascript/issues/5417#issuecomment-1188683105
@Lms24https://github.com/Lms24
https://github.com/Lms24
Lms24https://github.com/Lms24
on Jul 19, 2022https://github.com/getsentry/sentry-javascript/issues/5417#issuecomment-1188708177
Lms24https://github.com/Lms24
Status: Backloghttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Status%3A%20Backlog%22
on Jul 19, 2022https://github.com/getsentry/sentry-javascript/issues/5417#event-7018206878
https://github.com/rpanadero
rpanaderohttps://github.com/rpanadero
on Jul 19, 2022https://github.com/getsentry/sentry-javascript/issues/5417#issuecomment-1188792026
https://github.com/janvennemann
janvennemannhttps://github.com/janvennemann
on Jul 25, 2022https://github.com/getsentry/sentry-javascript/issues/5417#issuecomment-1194006216
@Lms24https://github.com/Lms24
https://github.com/janvennemann/sentry-callback-issuehttps://github.com/janvennemann/sentry-callback-issue
#1939https://github.com/getsentry/sentry-javascript/issues/1939
https://github.com/Luis-Palacios
Luis-Palacioshttps://github.com/Luis-Palacios
on Sep 9, 2022https://github.com/getsentry/sentry-javascript/issues/5417#issuecomment-1242236709
https://github.com/Lms24
Lms24https://github.com/Lms24
on Mar 3, 2023https://github.com/getsentry/sentry-javascript/issues/5417#issuecomment-1453407097
@rpanaderohttps://github.com/rpanadero
TryCatchhttps://docs.sentry.io/platforms/javascript/guides/angular/configuration/integrations/default/#trycatch
Lms24https://github.com/Lms24
Status: Needs Informationhttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Status%3A%20Needs%20Information%22
Status: Backloghttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Status%3A%20Backlog%22
on Mar 3, 2023https://github.com/getsentry/sentry-javascript/issues/5417#event-8659216759
https://github.com/llgarrido
llgarridohttps://github.com/llgarrido
on Mar 20, 2023https://github.com/getsentry/sentry-javascript/issues/5417#issuecomment-1476405688
@rpanaderohttps://github.com/rpanadero
https://github.com/Lms24
Lms24https://github.com/Lms24
on Mar 20, 2023https://github.com/getsentry/sentry-javascript/issues/5417#issuecomment-1476552640
Lms24https://github.com/Lms24
completedhttps://github.com/getsentry/sentry-javascript/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Mar 20, 2023https://github.com/getsentry/sentry-javascript/issues/5417#event-8796753126
Lms24https://github.com/Lms24
Status: Solvedhttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Status%3A%20Solved%22
Status: Needs Informationhttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Status%3A%20Needs%20Information%22
on Mar 20, 2023https://github.com/getsentry/sentry-javascript/issues/5417#event-8796754870
Lms24https://github.com/Lms24
on Jun 20, 2023https://github.com/getsentry/sentry-javascript/issues/5417#event-9580421072
fix(angular): Filter out `TryCatch` integration by default (#8367)https://github.com/getsentry/sentry-javascript/commit/e5e6a6bd8ab2bbec59879971595a7248fa132826
#8367https://github.com/getsentry/sentry-javascript/pull/8367
e5e6a6bhttps://github.com/getsentry/sentry-javascript/commit/e5e6a6bd8ab2bbec59879971595a7248fa132826
https://github.com/sparky-raccoon
sparky-raccoonhttps://github.com/sparky-raccoon
on Mar 5, 2024https://github.com/getsentry/sentry-javascript/issues/5417#issuecomment-1979235855
@Lms24https://github.com/Lms24
@janvennemannhttps://github.com/janvennemann
Sign up for freehttps://github.com/signup?return_to=https://github.com/getsentry/sentry-javascript/issues/5417
Sign in to commenthttps://github.com/login?return_to=https://github.com/getsentry/sentry-javascript/issues/5417
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

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlmax-age=0, private, must-revalidate

Viewport: width=device-width


URLs of crawlers that visited me.