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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This type of defensive check usually hides root causes. To always be suspicious.
Here, I suspect that because the cleanup happens in a useEffect, it's async, but it should be a layout effect to be sync. We might have similar cleanup problems in the other components.
https://github.com/mui-org/material-ui/blob/fcf2a8a5c90e6a975b0a8c391aa2f95f6e860b15/packages/mui-material/src/SwipeableDrawer/SwipeableDrawer.js#L510
I hope it illustrates why #30440 (comment) (not the only reason, e.g. so we can add a test case)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @oliviertassinari, thanks for you answer, I definitely agree. We've inlined the component in production to check, and it's not the root cause anyway, the sentries are still there, which sounds a bit surprising 🤔 I've also tried to replace this
useEffect
by auseLayoutEffect
, and still the same errorsI've tried various things to trigger the error, but no luck I didn't reproduce it yet. But it's not that edge case as we have 1k/day occurences on iOS and 1k/day on Android. Thus it doesn't look like OS-related, i'd say it's more about the react lifecycle itself