Title: Use attachments to store the Redux state · Issue #6266 · getsentry/sentry-javascript · GitHub
Open Graph Title: Use attachments to store the Redux state · Issue #6266 · getsentry/sentry-javascript
X Title: Use attachments to store the Redux state · Issue #6266 · getsentry/sentry-javascript
Description: Problem Statement When using the current Redux middleware, the latest state is set in the scope's context: sentry-javascript/packages/react/src/redux.ts Lines 105 to 111 in 99864fa /* Set latest state to scope */ const transformedState =...
Open Graph Description: Problem Statement When using the current Redux middleware, the latest state is set in the scope's context: sentry-javascript/packages/react/src/redux.ts Lines 105 to 111 in 99864fa /* Set latest st...
X Description: Problem Statement When using the current Redux middleware, the latest state is set in the scope's context: sentry-javascript/packages/react/src/redux.ts Lines 105 to 111 in 99864fa /* Set lates...
Opengraph URL: https://github.com/getsentry/sentry-javascript/issues/6266
X: @github
Domain: github.com
IPv4 address: 140.82.112.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Use attachments to store the Redux state","articleBody":"### Problem Statement\n\nWhen using the current Redux middleware, the latest state is set in the scope's context: https://github.com/getsentry/sentry-javascript/blob/99864fa55e0b2a843cdb06e338027a64275e8407/packages/react/src/redux.ts#L105-L111\r\n\r\nThis is a problem for big Redux states as the size of attributes in context is limited. But attachments are now added to the JS SDK, and are the perfect solution to this!\n\n### Solution Brainstorm\n\nInstead of storing the state in the context, it should be an attachment as those can be much bigger. I have been using this in my app for some time and it work great:\r\n\r\n```js\r\nSentry.addGlobalEventProcessor((event, hint) => {\r\n hint.attachments = [\r\n {\r\n filename: \"redux-state.json\",\r\n data: JSON.stringify(store.getState(), undefined, 2),\r\n },\r\n ]\r\n\r\n return event\r\n})\r\n```\r\n\r\nIf you think this is a good idea, I can submit a PR for this. This could also be a middleware setting if you prefer, as well as the attachment name.","author":{"url":"https://github.com/renchap","@type":"Person","name":"renchap"},"datePublished":"2022-11-23T09:07:21Z","url":"https://github.com/getsentry/sentry-javascript/issues/6266"}
| react-profiling | 0 |
| react-import-map | react,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-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:9c2b02dd-2e23-f11f-4976-645da5d1273b |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B230:E69EB:932FC1:C72535:6B04DAFF |
| html-safe-nonce | 3b7e08ca7771baa11b0eb098ddb090c1b0e10aa502e23fc072de2d38c12f6324 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMjMwOkU2OUVCOjkzMkZDMTpDNzI1MzU6NkIwNERBRkYiLCJ2aXNpdG9yX2lkIjoiMzgwMjQ3OTI2Nzg2NzMxOTAzOSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | b80412622286a6cc491d32942ee8d9554010dfe351b5512012c90075f5b6b54d |
| hovercard-subject-tag | issue:1461330762 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/getsentry/sentry-javascript/6266/issue_layout |
| twitter:image | https://opengraph.githubassets.com/7cf5d58cd63339525cb4c50c49057050b387490822b3be25ec2b69511244f485/getsentry/sentry-javascript/issues/6266 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/7cf5d58cd63339525cb4c50c49057050b387490822b3be25ec2b69511244f485/getsentry/sentry-javascript/issues/6266 |
| og:image:alt | Problem Statement When using the current Redux middleware, the latest state is set in the scope's context: sentry-javascript/packages/react/src/redux.ts Lines 105 to 111 in 99864fa /* Set latest st... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | renchap |
| hostname | github.com |
| expected-hostname | github.com |
| None | 194dacb8acfd3e4d3ffb2704e0b1f10327f0dad690a7142acc7b0e0a2d073965 |
| turbo-cache-control | no-preview |
| go-import | github.com/getsentry/sentry-javascript git https://github.com/getsentry/sentry-javascript.git |
| octolytics-dimension-user_id | 1396951 |
| octolytics-dimension-user_login | getsentry |
| octolytics-dimension-repository_id | 3328572 |
| octolytics-dimension-repository_nwo | getsentry/sentry-javascript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 3328572 |
| octolytics-dimension-repository_network_root_nwo | getsentry/sentry-javascript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 6c35540a0a2991ee20bd053ba2601cce33f72cb1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width