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

sessions replay with masking does not work cause image dispose before drawing #138

Closed
thisames opened this issue Dec 20, 2024 · 1 comment
Labels
bug Something isn't working Session Replay

Comments

@thisames
Copy link
Contributor

Version

4.9.0

Steps to Reproduce

when

config.sessionReplayConfig.maskAllTexts = true;
config.sessionReplayConfig.maskAllImages = true;

image

https://github.com/PostHog/posthog-flutter/blob/main/lib/src/replay/screenshot/screenshot_capturer.dart#L101-L103

Uint8List pngBytes = byteData.buffer.asUint8List();
image.dispose(); // <-----

image dispose but it still used in

        if (screenElementsRects != null) {
          final ui.Image maskedImage = await _imageMaskPainter.drawMaskedImage(
              image, screenElementsRects, pixelRatio);
          final imageInfo = ImageInfo(
              maskedImage,
              viewId,
              globalPosition.dx.toInt(),
              globalPosition.dy.toInt(),
              srcWidth.toInt(),
              srcHeight.toInt(),
              shouldSendMetaEvent,
              pngBytes);
          _updateStatusView(shouldSendMetaEvent, renderObject, statusView);
          return imageInfo;
        }

Expected Result

replay masking in dashboard

Actual Result

black replay in dashboard or broken replay in dashboard

@thisames thisames added the bug Something isn't working label Dec 20, 2024
@thisames
Copy link
Contributor Author

I'll send a pr fix for this now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Session Replay
Projects
None yet
Development

No branches or pull requests

2 participants