-
Notifications
You must be signed in to change notification settings - Fork 13.9k
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
Race condition in dashboards makes search results not reflect current filters #30872
Comments
To address the race condition in Superset dashboards where a slow search query overwrites the results of a faster search, you can implement a debouncing mechanism. This can be done using the Here's a snippet of how this is implemented: const publishDataMask = debounce(
async (
history,
dashboardId,
updateKey,
dataMaskSelected: DataMaskStateWithId,
tabId,
) => {
// ... existing logic to update URL parameters
},
SLOW_DEBOUNCE,
); The Additionally, Superset's frontend can handle the cancellation of ongoing queries when a new query is initiated by using an |
@dosu That would be true in my own application, but I do not own superset's react code. |
In Superset, handling query cancellations and ensuring that only the latest query results are displayed can be managed using the Additionally, the These mechanisms can help address the issue of race conditions in query execution by ensuring that only the most recent query results are displayed. |
That's the joy of it! Nobody does! If you feel like opening a PR, we'd be plenty happy to review it. |
If you're interested in contributing a fix, you can fork the repository and make the necessary changes to handle query cancellations using the |
I thought my comment would get that response 😅. We'll see if the issue is as big a blocker as someone claimed and go from there. |
Bug description
✅ The fast search will return and show up on the page
and then
❌ When the slow search completes, it will clobber the table content with the original search query results, putting you in a state where the data presented does not match the last thing searched.
I think when a new query is run, the old query needs to be cancelled/promise rejected.
Screenshots/recordings
Superset_race_condition.mov
Superset version
4.0.2
Python version
3.10
Node version
18 or greater
Browser
Chrome
Additional context
We have enabled
EMBEDDED_SUPERSET
,HORIZONTAL_FILTER_BAR
, andEMBEDDABLE_CHARTS
, though this video is in the superset app.The datasource is a redshift table
Checklist
The text was updated successfully, but these errors were encountered: