[DevTools] fix: validate url in file fetcher bridging calls (#34498)
This was prone to races and sometimes messed up symbolication when multiple source maps were fetched simultaneously.
Ruslan Lesiutin committed
Sep 15, 2025 at 18:14 UTC
92d7ad5dd976f4b7bc22abc507569b30609b1579
1 file changed
+1
-1
packages/react-devtools-extensions/src/main/fetchFileWithCaching.js
+1
-1
@@ -82,7 +82,7 @@ const fetchFromPage = async (url, resolve, reject) => {
82
debugLog('[main] fetchFromPage()', url);
83
84
function onPortMessage({payload, source}) {
85
- if (source === 'react-devtools-background') {
85
+ if (source === 'react-devtools-background' && payload?.url === url) {
86
switch (payload?.type) {
87
case 'fetch-file-with-cache-complete':
88
chrome.runtime.onMessage.removeListener(onPortMessage);