You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
DevTools scroll-to error or warning feature broken #22143
Not sure when this happened, but the feature got broken:
scroll-to-broken.mp4
Using the up/down arrows to navigate the list works fine, but jumping to the next/previous component with a warning or error doesn't quite work correctly. (The scroll offset is wrong so the component is often not visible.)
I can reproduce on Version 92.0.4515.159 (Official Build) (64-bit) (with and without our good friend "Throttle non-visible cross-origin iframes" enabled).
Though it does scroll. It just is a bit offset. It also seems to work on upward movement if the current node is already in the frame.
When we call store.getElementsWithErrorsAndWarnings() we get a cached list of elements with their indices and ids. The problem is that we only update this list when errors or warning change. But the indices of these elements can change with other operations as well so we need to invalidate the cache more often (or at least update the indices).
If I just naively invalidate the cache on every operation, the issue is no longer reproducible:
diff --git a/packages/react-devtools-shared/src/devtools/store.js b/packages/react-devtools-shared/src/devtools/store.js
index 16bc56ae64..af2ed945c4 100644
--- a/packages/react-devtools-shared/src/devtools/store.js+++ b/packages/react-devtools-shared/src/devtools/store.js@@ -1124,7 +1124,7 @@ export default class Store extends EventEmitter<{|
this._revision++;
- if (haveErrorsOrWarningsChanged) {+ if (true) {
let errorCount = 0;
let warningCount = 0;
I may have an idea how to update the cache more "smartly".
I wonder if this is related to a Chrome experimental flag? I can repro in both Chrome stable and canary.
I only tested with the default instead of enabled, because when it is enabled it freezes everything, I am using Brave 1.28.105 Chromium: 92.0.4515.131, DevTools version 4.16.0-1d2528097. Same behavior on Chromium(without Brave) 92.0.4515.159.
I also notice sometimes the tool doesn't work, unless I change the code and it hot reloads
Activity
iunfixit commentedon Aug 20, 2021
I cannot reproduce this unless I'm doing something wrong, tested with errors here
The part where it is selected outside of the view is because of the recording, it never goes behind the console
bvaughn commentedon Aug 20, 2021
I wonder if this is related to a Chrome experimental flag? I can repro in both Chrome stable and canary.
eps1lon commentedon Aug 20, 2021
I can reproduce on Version 92.0.4515.159 (Official Build) (64-bit) (with and without our good friend "Throttle non-visible cross-origin iframes" enabled).
Though it does scroll. It just is a bit offset. It also seems to work on upward movement if the current node is already in the frame.
Notice how the scrollbar actually moves:
devtools-scroll-to-warning.mp4
eps1lon commentedon Aug 20, 2021
When we call
store.getElementsWithErrorsAndWarnings()we get a cached list of elements with their indices and ids. The problem is that we only update this list when errors or warning change. But the indices of these elements can change with other operations as well so we need to invalidate the cache more often (or at least update the indices).If I just naively invalidate the cache on every operation, the issue is no longer reproducible:
I may have an idea how to update the cache more "smartly".
iunfixit commentedon Aug 20, 2021
I only tested with the default instead of enabled, because when it is enabled it freezes everything, I am using Brave 1.28.105 Chromium: 92.0.4515.131, DevTools version 4.16.0-1d2528097. Same behavior on Chromium(without Brave) 92.0.4515.159.
I also notice sometimes the tool doesn't work, unless I change the code and it hot reloads
The code is just modified from the latest CRA