Current Behavior
In apps/meteor/client/views/invite/hooks/useValidateInviteQuery.ts, there is an outstanding architectural technical debt marker:
// FIXME: decouple this state management from the query
Currently, useValidateInviteQuery dispatches global session state side-effects (setLoginDefaultState) directly inside its asynchronous queryFn. This violates React Query anti-patterns, blurring the lines between pure data-fetching and UI state mutation, making the hook harder to test and reuse.
Expected Behavior
The setLoginDefaultState side-effects should be extracted completely from the useValidateInviteQuery fetcher logic. Instead, the UI component consuming the data (InvitePage.tsx) should track the query's isSuccess/data state and dispatch the session updates deterministically via a useEffect.
Tasks