Skip to content

Allow to pass custom compression implementation to replay #7755

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

Closed
mydea opened this issue Apr 5, 2023 · 4 comments
Closed

Allow to pass custom compression implementation to replay #7755

mydea opened this issue Apr 5, 2023 · 4 comments
Labels
Package: replay Issues related to the Sentry Replay SDK

Comments

@mydea
Copy link
Member

mydea commented Apr 5, 2023

Since #6739 is sadly not really possible due to browser constraints, another way to allow people to opt-out of the worker behavior while still having compression could be to allow passing in a custom compression implementation.

We could provide this implementation ourselves, but let it be tree shaken away if not used. This is how this could look like:

import * as Sentry from '@sentry/browser';

const replay = new Replay({
  compression: Sentry.getReplayEventCompressionCallback()
});

Where getReplayEventCompressionCallback would return a function that uses pako.

@AbhiPrasad
Copy link
Member

Allowing it to be treeshaken this way is a pretty substantial change - every person who is using Replay then has to go in and update their init to add this new snippet.

I would rather
a) allow people to pass in a compression strategy but keep the default without treeshaking it out
b) provide a bundler flag that users can use to tree-shake out this behaviour, but it only works if you either disable compression or pass in a compression strategy.

@mydea
Copy link
Member Author

mydea commented Apr 5, 2023

Allowing it to be treeshaken this way is a pretty substantial change - every person who is using Replay then has to go in and update their init to add this new snippet.

I would rather a) allow people to pass in a compression strategy but keep the default without treeshaking it out b) provide a bundler flag that users can use to tree-shake out this behaviour, but it only works if you either disable compression or pass in a compression strategy.

So the idea is to allow to pass in an optional config, not require it. Nothing should change for existing (or new) users, unless they specifically choose to pass in a compression function.

@github-actions
Copy link
Contributor

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you label it Status: Backlog or Status: In Progress, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

@mydea
Copy link
Member Author

mydea commented May 2, 2023

Closing for now, as not sure if we actually need/want to provide this. It should also be OK to send stuff uncompressed, if it doesn't work any other way.

@mydea mydea closed this as not planned Won't fix, can't repro, duplicate, stale May 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Package: replay Issues related to the Sentry Replay SDK
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants