evidence icon indicating copy to clipboard operation
evidence copied to clipboard

Unset input values are always in a loading state

Open ItsMeBrianD opened this issue 2 years ago • 2 comments

Current behavior is an input value that is unset freezes the QueryStore to prevent errors; this is an intentional behavior.

The problem comes from inputs like ButtonGroup that may not have a default value, or where no selection (and no value) is a valid choice.

We should adjust the behavior to enter the "forever loading" state when the input value is undefined, and we should pass along null. null is an intentional empty where undefined is unintentional.

Components that do not need a default or initial value are responsible for setting their input key to null, Evidence should not handle this.

ItsMeBrianD avatar Jan 10 '24 19:01 ItsMeBrianD

From @archiewood in #1480

Steps To Reproduce

Navigate to https://mdsinabox.com/nba/teams/

view the query filtered_summary_by_team

Inspect the SQL

CleanShot 2024-01-10 at 15 00 45@2x

Expected Behavior

The user has not selected a button yet, so the input result is null, and returns the expected query results for if '${inputs.my_input}' was null

Actual Behaviour

CleanShot 2024-01-10 at 15 00 45@2x

The query does not return data and so remains in a loading state

Workarounds

Create an {#if} block before the results are available, returning different data. See the source code

ItsMeBrianD avatar Jan 10 '24 21:01 ItsMeBrianD