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

ParameterChanged event creates race condition #175

Closed
jhegele opened this issue Nov 21, 2018 · 4 comments
Closed

ParameterChanged event creates race condition #175

jhegele opened this issue Nov 21, 2018 · 4 comments

Comments

@jhegele
Copy link

jhegele commented Nov 21, 2018

This is a bit of a quirky bug that I've run into a couple of times now. If I have a dashboard that requires time to recalculate the view layout after a parameter change, a race condition is created between the ParameterChanged event firing and the data completing its update. When a parameter is changed, it looks like the event fires immediately which causes issues if you are subsequently using getSummaryData(). Here's an example:

race-cond-example

When I update the parameter (at the bottom of the viz), it updates the bar chart to contain nine orange bars. However, my extension is pulling summary data from a much more complex sheet where the view takes longer to render. So, the extension is getting "old" summary data that indicates that only four bars are orange because the ParameterChanged event is firing before the data is actually updated. After I manually reload the extension, it shows the correct value since all of the views have updated and rendered.

For my general use case, this issue is likely solvable via issue #167. But wanted to add a dedicated issue for this item as there may be more nuanced use cases as well.

@jhegele
Copy link
Author

jhegele commented Nov 21, 2018

Quick follow-up as I'm seeing the same thing on MarkSelection events. I suspect that anytime you set an event listener and subsequently want to pull data, there is a risk of this race condition occurring.

@LGraber
Copy link

LGraber commented Dec 18, 2018

Thanks John. I will open an item on this as the behavior here should be more predictable, regardless of whether we have a summaryDataChangedEvent (which is not in the immediate plans).

@LGraber
Copy link

LGraber commented Jan 4, 2019

As an update John ... can you confirm that you are only seeing this on desktop? We are actively working on a fix for this that should address this issue on desktop. This should not occur on server.

@LGraber
Copy link

LGraber commented Apr 19, 2019

This should have been resolved in 2019.1. Please let us know if you are still seeing this. This only occurred if the underlying db query was not fast enough and we ended up popping up a progress dialog.

@LGraber LGraber closed this as completed Apr 19, 2019
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

No branches or pull requests

2 participants