Skip to content
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

feat(vue): Apply stateTransformer to attachments in createSentryPiniaPlugin #14474

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

sircharlo
Copy link

This PR modifies the createSentryPiniaPlugin to apply the stateTransformer to attachments, in addition to the context.

Why?

Attachments can quickly become large when the full store.$state is included, especially if there are items that do not need to be reported to Sentry. By applying the stateTransformer, developers can reduce the size of attachments, avoid unnecessary data uploads, and stay within their Sentry usage limits.

Changes

  • Moved some code around to transform store.$state using the stateTransformer (if provided) before including it in the attachments as well as the context.

Benefits

  • Reduces the size of attachments.
  • Prevents unnecessary data from being sent to Sentry.
  • Helps avoid hitting monthly usage caps prematurely.

Let me know if further adjustments are needed!


Before submitting a pull request, please take a look at our
Contributing guidelines and verify:

  • If you've added code that should be tested, please add tests.
  • Ensure your code lints and the test suite passes (yarn lint) & (yarn test).

@onurtemizkan
Copy link
Collaborator

Thanks for the PR @sircharlo. Implementation looks good to me, could you also add a test for this?

@sircharlo
Copy link
Author

Thanks for the PR @sircharlo. Implementation looks good to me, could you also add a test for this?

Erm I can try. Not sure, I had started adding something in e2e but in the Discord I was told that was the wrong place for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants