fix(events): auto load new events checkbox issue #25039
Open
+14
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
When the
Automatically load new events
checkbox is unchecked and the user cancels the ongoing query, the error message displayed is "The query was cancelled" - which is correct.However, after this, when the checkbox is checked, the error is about
AbortSignal
and it does not trigger a refetch immediately.When you cancel the ongoing query when the
Automatically load new events
checkbox is checked, you will see theAbortSignal
error.Here's the bug:
bug-autoload.mov
Changes
loadNewData
prioritises new response if the existing response is null.posthog/frontend/src/queries/nodes/DataNode/dataNodeLogic.ts
Lines 238 to 264 in dfbd23b
Lines 258-262 here show that the object returned from the loader will only have
results
key ifvalues.response
is nullresponseError
reducer also reacts toloadNewData...
actions; this helps to get rid of the error state when new data is loaded.When you cancel the ongoing query when the
Automatically load new events
checkbox is checked, you will not see any error state in the table - this is because the auto load functionality will trigger a refetch in 30s anyways, so it is not a good UX to show an error state only for it to be replaced with the table after 30s.Here's the fix:
fix.mov