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

Create a single cancel callback for each unique input. #2599

Merged
merged 10 commits into from
Jul 18, 2023
Merged

Create a single cancel callback for each unique input. #2599

merged 10 commits into from
Jul 18, 2023

Conversation

T4rk1n
Copy link
Contributor

@T4rk1n T4rk1n commented Jul 13, 2023

Partial fix for #2588, create a cancel callback for each unique cancel input of background callback. This allow to use a location input shared across pages (_pages_location_container) in multiple background callbacks cancel.

@T4rk1n T4rk1n requested a review from alexcjohnson as a code owner July 13, 2023 14:07
@T4rk1n T4rk1n requested a review from KoolADE85 July 17, 2023 15:11
time.sleep(2.1)
dash_duo.wait_for_text_to_equal("#output1", "initial")

dash_duo.server_url = dash_duo.server_url + "/2"
Copy link
Contributor

Choose a reason for hiding this comment

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

What is the purpose of having 2 pages for this test?
As far as I can tell, this effectively tests the same thing twice (once for each page).
Did you mean to test switching pages while a callback is pending? Or do I misunderstand what you're looking for in this test?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Before you couldn't use the same input for multiple background callbacks and if you used one that is on every page and one that is only on one page it also bugged.
Testing page switching is not easy to get feedback for the cancellation, this test just use button instead with the cases above.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ahhh, I see now. I missed that #cancel persists across pages.
Maybe this would be easier to understand at a glance if cancel was named something more descriptive like shared_cancel or persistent_cancel.

Just a minor thought, otherwise this looks great to me.

@T4rk1n T4rk1n merged commit 3c43d95 into dev Jul 18, 2023
@T4rk1n T4rk1n deleted the fix/#2588 branch July 18, 2023 19:47
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.

2 participants