Reproduce RUMS-5633: images not appearing in Session Replay#977
Reproduce RUMS-5633: images not appearing in Session Replay#977
Conversation
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>
|
This one's pretty good! 100% the 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 ? |
|
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. |
Reproduction for RUMS-5633
Jira: RUMS-5633
Issue Summary
Customer reports PNG images from
Image.asset()are not appearing in Session Replay despiteimagePrivacyLevelbeing set toImagePrivacyLevel.maskNone.Reproduction Tests
packages/datadog_session_replay/test/capture/image_asset_reproduction_test.dart)What the Tests Prove
Default config masks all images (passes, confirming expected behavior):
DatadogSessionReplayConfigurationdefaultsimagePrivacyLeveltomaskAll. If the customer'smaskNoneoverride doesn't propagate correctly, all images appear as placeholders.Null
resourceIdcauses missing images (fails): When the native platform'sresourceIdForKey()returnsnull(due to processing failure or timing issues),SRImageWireframeis created withresourceId: null. The Session Replay player cannot render an image without a validresourceId, causing images to "not appear."_extractAssetImagedoesn't handle all asset providers (fails): WithmaskNonAssetsOnly, image providers that are not exactlyAssetImageorResizeImage(AssetImage)— such asExactAssetImage(used byImage.asset(scale: ...)) — are incorrectly treated as non-asset images and masked with placeholders.Failure Output
Generated by rum:tee-triage-insights