Skip to content
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

Reactive toolbar: avoid simultaneous calls to _onResize() #16335

Merged
merged 1 commit into from
May 17, 2024

Conversation

brichet
Copy link
Contributor

@brichet brichet commented May 16, 2024

This PR fixes an edge case where the _onResize() method of the reactiveToolbar can be called 2 times simultaneously.

Follows up #15553

On the first load of a reactive toolbar, the _onResize() method need to be called twice, to ensure the proper organization of the widgets. But the second call was not properly awaited before this PR.
In parallel, if an item is added during the second call, the method can be invoked again and can run simultaneously, which result in conflicts in the items count and ordering (it doesn't seem to happen too often, though).

References

Should fix jupyter/notebook#7370

Code changes

Add an await on the optional second call of _onResize()

User-facing changes

None

Backwards-incompatible changes

None

cc @jtpio

Copy link

Thanks for making a pull request to jupyterlab!
To try out this branch on binder, follow this link: Binder

@brichet brichet added the bug label May 16, 2024
@jtpio jtpio added this to the 4.2.x milestone May 16, 2024
Copy link
Member

@jtpio jtpio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Restarted the failing UI test just to double check, otherwise looks good 👍

@jtpio jtpio merged commit 44b82c8 into jupyterlab:main May 17, 2024
84 of 85 checks passed
@jtpio
Copy link
Member

jtpio commented May 17, 2024

@meeseeksdev please backport to 4.2.x

meeseeksmachine pushed a commit to meeseeksmachine/jupyterlab that referenced this pull request May 17, 2024
@brichet brichet deleted the fix_reactive_toolbar branch May 17, 2024 07:52
krassowski pushed a commit that referenced this pull request May 19, 2024
…Resize() (#16338)

Co-authored-by: Nicolas Brichet <32258950+brichet@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Flaky UI tests
2 participants