Repository navigation
Conversation
Collaborator
Author
…events `NetworkReporter::reportResponseEnd` erases the request's `ResourceTimingData` after reporting `PerformanceResourceTiming`, then looks the same entry up again to pass `decodedBodySize` for `image/*` responses to `PerformanceTracer::reportResourceFinish`. The second lookup always misses, so every `ResourceFinish` trace event has `decodedBodyLength: 0`, and the DevTools Performance panel shows "0 B" decoded size for image requests reported through `NetworkReporter` (`fetch`/XHR, and third-party image libraries that report to it). This has never worked with `enableResourceTimingAPI` on, which is the default from 0.83: react#53840 added the lookup after that flag's erase. react#54511 later made the erase unconditional. This change reads the value before the erase and drops the second lock and lookup. A response with no known content length reports -1 here, which is clamped to 0 rather than shown as "-1B". Changelog: [General][Fixed] - **React Native DevTools**: Fix decoded body size always showing 0 for image network requests in the Performance panel
robhogan
force-pushed
the
rn-image-decoded-size
branch
from
November 23, 2026 19:58
53f57de to
7cfcef5
Compare
huntie
approved these changes
Nov 24, 2026
Collaborator
|
Awesome, let's do that, definitely a small bug fix! @huntie-bot action on merge. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
NetworkReporter::reportResponseEnderases the request's timing entry, then looks it up again to getdecodedBodySizeforimage/*responses. That lookup always misses, so the Performance panel shows "0 B" decoded size for every imagefetch/XHR:react-native/packages/react-native/ReactCommon/react/networking/NetworkReporter.cpp
Lines 207 to 225 in 684b6a5
This has never worked with
enableResourceTimingAPIon, which is the default from 0.83: #53840 added the lookup after that flag's erase. This reads the value before the erase, clamped to 0 because it's -1 when the content length is unknown.Changelog:
[General][Fixed] - React Native DevTools: Fix decoded body size always showing 0 for image network requests in the Performance panel
Test Plan:
New C++ test, which fails on
mainwithdecodedBodyLength: 0. Also checked the non-debugger build compiles under-Werror.Screenshots of the "Decoded body" row for a
fetchof a PNG in RNTester on Android:Before
After