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

Change AccordionInputBinding.receiveMessage to async #874

Merged
merged 10 commits into from
Oct 30, 2023

Conversation

wch
Copy link
Collaborator

@wch wch commented Oct 28, 2023

This fixes #872. It should be used with rstudio/shiny#3930.

With this PR, this what the test app from #872 looks like when it starts:

image

@wch wch force-pushed the async-receivemessage branch from c07521e to 07cb6d5 Compare October 28, 2023 21:35
@wch wch requested a review from cpsievert October 28, 2023 21:36
@wch
Copy link
Collaborator Author

wch commented Oct 28, 2023

Note that I wasn't able to successfully re-run yarn because I have a different system version of yarn from what others are using. (Once #788 is merged then we'll be able to consistently run yarn without worrying about the system version.)

Before releasing, we'll want to update the shiny version referred to in DESCRIPTION and in package.json.

@wch wch marked this pull request as ready for review October 28, 2023 21:40
@wch
Copy link
Collaborator Author

wch commented Oct 28, 2023

Just to add a bit of detail: each message sent (via the R functions accordion_panel_insert() and accordion_panel_open() ends up putting a message on the JS side in the actionQueue, where they are handled as serially -- by awaiting each message handler.

This PR makes receiveMessage async, and within it, it awaits each call to renderContent. These changes (along with the PR in Shiny) ensure that the messages are handled in order, without any interleaved processing of them.

@cpsievert cpsievert force-pushed the async-receivemessage branch from 7c709f8 to ac77653 Compare October 30, 2023 18:22
@cpsievert cpsievert merged commit 17e5b38 into main Oct 30, 2023
11 checks passed
@cpsievert cpsievert deleted the async-receivemessage branch October 30, 2023 18:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to open a newly inserted accordion panel
2 participants