Skip to content

ParameterChanged event creates race condition #175

Closed
@jhegele

Description

@jhegele

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions