Skip to content

RTK Query migration#1

Open
mcoughlin wants to merge 1 commit into
thomasculino:fix-test-frontend-boomfrom
mcoughlin:fix-boom-rtk-query-selectors
Open

RTK Query migration#1
mcoughlin wants to merge 1 commit into
thomasculino:fix-test-frontend-boomfrom
mcoughlin:fix-boom-rtk-query-selectors

Conversation

@mcoughlin

Copy link
Copy Markdown

Fix RTK

…rces from query hooks

The RTK Query migration (skyportal #6209) removed the `groups`, `source`, and
`sources` redux slices, but the BOOM alert components still read them via
useAppSelector (state.groups.userAccessible/.all, state.source, state.sources.latest).
Those now resolve to undefined -> TypeError on render -> the alerts list and
detail pages render blank, failing every boom frontend test.

Read them from the RTK Query hooks instead, matching skyportal's own migrated
pattern:
- groups  -> useGetGroupsQuery().data?.{userAccessible,all} ?? []
- source  -> the useLazyGetSourceQuery() result's .data
- sources -> the useLazyFetchSourcesQuery() result's .data

The base PR converted the dispatchable thunks (fetchSource/checkSource/fetchSources)
to lazy-query triggers but left these selectors pointing at the removed slices.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant