Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ export const useUrlStateService = <K extends Accessor, T>(
? state?.[optionsRef.current.pageKey]
: state;

const setCallback = useRef<typeof setState>();
const setCallback = useRef<typeof setState>(setState);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good, preventing the crashes which I have been seeing when changing the filter.

However looks like the URL is persisting the anomalies table page index when changing properties of the view, such as the selected job ID(s). I think we should reset the page index to 0 when changing the selected job(s). @rbrtj @darnautov what do you think? I'd still recommend getting this fix in, and then potentially doing the reset in a follow-up unless it's a simple change.

Copy link
Copy Markdown
Contributor Author

@rbrtj rbrtj Mar 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should definitely reset the page index to 0 when changing the selected jobs, in my opinion.
Also, without this fix, the page would crash if we select a page in the anomalies table that is not available for a different job (..and then we change the job).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed offline, let's fix the page index reset to 0 in a separate PR, and get this fix for the page crash in first.


useEffect(() => {
setCallback.current = setState;
Expand Down