-
Notifications
You must be signed in to change notification settings - Fork 450
Fix some test and non-test warnings #5294
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix some test and non-test warnings #5294
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5294 +/- ##
==========================================
- Coverage 88.61% 88.61% -0.01%
==========================================
Files 308 308
Lines 28125 28122 -3
Branches 7621 7620 -1
==========================================
- Hits 24923 24920 -3
Misses 2987 2987
Partials 215 215 ☔ View full report in Codecov by Sentry. |
canova
left a comment
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.
Thanks for fixing the warnings! Looks good to me, but let me know what you think about the comment below. It's fine by me if you choose to go with the current approach too.
| // As of React 18, If the action dispatch isn't delayed, the component will | ||
| // get rerendered with the redux changes before the react state changes are | ||
| // applied. As a result CurrentProfileUploadedInformationLoader could reset | ||
| // the profile information faster than this metaInfoPanelState was applied, | ||
| // and we were getting an error in _renderMetaInfoButton. | ||
| // Using requestAnimationFrame ensures that this component's state | ||
| // is properly applied before changing the redux state. Note that if we were | ||
| // using a function component, we could use useLayoutEffect instead. | ||
| // Note that this might not be necessary in future versions of React or | ||
| // React-Redux, so be sure to revisit this choice in the future. | ||
| requestAnimationFrame(() => { | ||
| this.props.profileRemotelyDeleted(); | ||
| }); |
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.
Hm this is a bit hacky, but if it works it's okay for me I guess. Do we always know for sure that requestAnimationFrame will be enough for it to update the state?
Another solution might be to have a componentDidUpdate that checks if the metaInfoPanelState state has changed, and calls profileRemotelyDeleted only if it's changed.
48da62f to
61f1010
Compare
|
Hey @canova , I updated the code like we discussed, this looks better to me, thanks for the feedback! |
canova
left a comment
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.
Looks good to me! Also tested it and it works well, thanks!
Updates: [Nicolas Chevobbe] Adapt Keyboard shortcut dialog in High Contrast Mode. (#5245) [Nicolas Chevobbe] Fix sidebar-toggle in High Contrast Mode. (#5246) [Nicolas Chevobbe] Fix timeline selection overlay time / hover line in High Contrast Mode (#5247) [Zac Spitzer] fix broken link for processed profile format (#5267) [Greg Tatum] Update the memory allocation docs and add DHAT docs (#5270) [Markus Stange] Simplify some code related to thread CPU deltas (#5265) [Greg Tatum] Update dhat convertor to work better with valgrind (#5269) [Markus Stange] Rename UniqueStringArray to StringTable. (#5283) [Markus Stange] Use snapshot testing in the symbolicator CLI test. (#5284) [Markus Stange] Fix two confused upgraders which didn't expect to be run on the serialized format. (#5285) [Nicolas Chevobbe] Fix timelineSettingsHiddenTracks in High Contrast Mode. (#5250) [Julien Wajsberg] Fix some test and non-test warnings (#5294) [Nisarg Jhaveri] Support importing simpleperf trace files from Android Studio (#5212) [Sean Kim] Add HTTP response status code in the profiler network tab (#5297) [Markus Stange] Change StringTable API a bit. (#5286) [Markus Stange] Correctly declare imported simpleperf trace profiles to be of the current version. (#5312) [Markus Stange] Two small changes (#5313) [Nazım Can Altınova] Show sample tooltips on sample graph hover (#5298) Also thanks to our localizers: en-CA: chutten es-CL: ravmn es-CL: ravmn fr: Théo Chevalier ia: Melo46 ia: Melo46 sv-SE: Andreas Pettersson uk: Lobodzets zh-TW: Olvcpr423
This fixes 2 warnings:
button.clickinstead offireEvent.click. The former isn't wrapped byactwhile the latter is.