Skip to content

Reproduce RUMS-5633: images not appearing in Session Replay#977

Draft
mariusc83 wants to merge 3 commits intodevelopfrom
mconstantin/RUMS-5633/images-not-appearing-session-replay
Draft

Reproduce RUMS-5633: images not appearing in Session Replay#977
mariusc83 wants to merge 3 commits intodevelopfrom
mconstantin/RUMS-5633/images-not-appearing-session-replay

Conversation

@mariusc83
Copy link
Copy Markdown
Member

@mariusc83 mariusc83 commented Mar 25, 2026

Reproduction for RUMS-5633

Jira: RUMS-5633

Issue Summary

Customer reports PNG images from Image.asset() are not appearing in Session Replay despite imagePrivacyLevel being set to ImagePrivacyLevel.maskNone.

Reproduction Tests

  • Unit tests: 3 (in packages/datadog_session_replay/test/capture/image_asset_reproduction_test.dart)
  • Integration tests: 0

What the Tests Prove

  1. Default config masks all images (passes, confirming expected behavior): DatadogSessionReplayConfiguration defaults imagePrivacyLevel to maskAll. If the customer's maskNone override doesn't propagate correctly, all images appear as placeholders.

  2. Null resourceId causes missing images (fails): When the native platform's resourceIdForKey() returns null (due to processing failure or timing issues), SRImageWireframe is created with resourceId: null. The Session Replay player cannot render an image without a valid resourceId, causing images to "not appear."

  3. _extractAssetImage doesn't handle all asset providers (fails): With maskNonAssetsOnly, image providers that are not exactly AssetImage or ResizeImage(AssetImage) — such as ExactAssetImage (used by Image.asset(scale: ...)) — are incorrectly treated as non-asset images and masked with placeholders.

Failure Output

Test 2: Expected resourceId to be non-null, but SRImageWireframe.resourceId is null
         when platform.resourceIdForKey returns null.

Test 3: Expected no placeholder wireframes, but _extractAssetImage fails to recognize
         non-AssetImage providers, causing RawImage to be masked with placeholder.

Generated by rum:tee-triage-insights

mariusc83 and others added 3 commits March 25, 2026 13:22
Add failing tests demonstrating two bugs in ImageRecorder:
1. Null resourceId from platform propagates to SRImageWireframe,
   causing the Session Replay player to not render the image.
2. _extractAssetImage doesn't recognize all asset image providers
   (e.g., ExactAssetImage), incorrectly masking them with
   maskNonAssetsOnly.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The previous test claimed to reproduce the ExactAssetImage detection bug
but used TestImageProvider (a generic ImageProvider) instead. This commit
introduces TestExactAssetImage — a real ExactAssetImage subclass that
preserves the type hierarchy while being loadable in tests.

The test now directly proves:
- ExactAssetImage is NOT an AssetImage (sibling classes under
  AssetBundleImageProvider)
- _extractAssetImage fails to detect it under maskNonAssetsOnly
- The image gets incorrectly masked as a placeholder

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ture

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@fuzzybinary
Copy link
Copy Markdown
Member

This one's pretty good! 100% the ExactAssetImage is a miss. If the customer is complaining about assets missing, than this is the cause (and it looks like that's the case here).

The second issue it brings up -- it doesn't really address what the root cause of the null resource id is, right? If the platform returns a null resource id, something went wrong is processing, so what went wrong is the root cause, which it didn't analyze. It's not enough here to say "guard against null resourceIds". The Player does guards against null resource ids by supplying a placeholder.

@mariusc83
Copy link
Copy Markdown
Member Author

This one's pretty good! 100% the ExactAssetImage is a miss. If the customer is complaining about assets missing, than this is the cause (and it looks like that's the case here).

The second issue it brings up -- it doesn't really address what the root cause of the null resource id is, right? If the platform returns a null resource id, something went wrong is processing, so what went wrong is the root cause, which it didn't analyze. It's not enough here to say "guard against null resourceIds". The Player does guards against null resource ids by supplying a placeholder.

On the second part, I would argue that an image with null resource id will still create a placeholder and that might still be a cause of the problem right ?

@fuzzybinary
Copy link
Copy Markdown
Member

Yes, but the problem isn't that a null resource id creates a placeholder (that's expected), the problem is that we got a null resource id in the first place.

@mariusc83
Copy link
Copy Markdown
Member Author

Yes, but the problem isn't that a null resource id creates a placeholder (that's expected), the problem is that we got a null resource id in the first place.

That's correct. So the approach should have been to check the problem at the bottom in the native layer. The problem though is that this could happen in the client's app randomly. Depending on what they're using for creating images/assets. So it would have been really hard to handle that in a test. So I would say the test it added here is still valuable as it is showing you a case where this could happen.

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