-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Description
Describe the issue
Currently, we tend not to check if a given variable in the state is populated in actions and do an API call whatever the state currently is (for eg. plugins) leading to duplicate calls while we already have the info. It impacts users that are staying for a long time on the UI not refreshing because they could benefit from a stateful application as they browse the UI with lower loading times.
In actions we should check if it's some data that are worth being kept in state, if that's the case then add some if (state.a !== undefined) return state.a
to avoid redoing the fetch.
This could take some time and lead to undesired behavior but in that case maybe keeping a state for a variable that is changing between each calls is not desired.
Most likely there will be cases where we could use the state but under the condition that each "root" component properly unmounts and reset its state variables so that the action is able to know that it should do the fetch again.
Environment
- Kestra Version: develop
Metadata
Metadata
Assignees
Labels
Type
Projects
Status