fix(logs) - Fix logs table when auto-refresh toggles#116332
fix(logs) - Fix logs table when auto-refresh toggles#116332adrianviquez wants to merge 3 commits into
Conversation
📊 Type Coverage Diff✅ No new type safety issues introduced. Coverage: 93.59% |
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 483c2c2. Configure here.
nsdeschenes
left a comment
There was a problem hiding this comment.
One small nit, and a question 👀
| <ProviderWrapper> | ||
| <LogsTabContentHarness datePageFilterProps={datePageFilterProps} /> | ||
| </ProviderWrapper>, |
There was a problem hiding this comment.
nit: You can just pass ProviderWrapper to the additionalWrapper field in the second argument object.
| // Reset the query data when auto-refresh is disabled to avoid stale data when switching between modes | ||
| useEffect(() => { | ||
| if (prevAutorefreshEnabled && !autorefreshEnabled) { | ||
| queryClient.resetQueries({queryKey: tableData.queryKey}); | ||
| } | ||
| }, [autorefreshEnabled, prevAutorefreshEnabled, queryClient, tableData.queryKey]); |
There was a problem hiding this comment.
Is there anyway to move this logic into the event handler the user is using to toggle auto-refresh?
|
|
||
| const [sidebarOpen, setSidebarOpen] = useState(mode === Mode.AGGREGATE); | ||
|
|
||
| const prevAutorefreshEnabled = usePrevious(autorefreshEnabled); |
There was a problem hiding this comment.
we shouldn’t use the usePrevious hook, it violates the rules of react and should be deprecated imo. To access information from previous render, see:
The logs table behaves inconsistently in two scenarios:
See this video
The fixes:
undefinedResult:
Additionally, added tests and modified the virtualStreaming spec to use the location router instead of the mocked one.
Closes LOGS-821