test: cover user-provider reconnect-resync branch #106

Closed
opened 2026-06-21 05:05:39 +03:00 by Ghost · 0 comments

PR #101 (commit e52f069f, #66) added reconnect-resync to apps/client/src/features/user/user-provider.tsx: a firstConnect flag so that only on a socket reconnect it invalidates the root-sidebar-pages and sidebar-pages query keys (first connect must NOT invalidate).

Gap: untested; the project has no socket/provider test harness yet.

Needed: if a fake-socket/provider harness is feasible (Vitest, like the provider tests added in this PR), mount UserProvider with a stubbed socket + queryClient, emit connect twice, and assert invalidateQueries fires only on the second connect, for both keys.

Found in code review of PR #101.

PR #101 (commit e52f069f, #66) added reconnect-resync to apps/client/src/features/user/user-provider.tsx: a `firstConnect` flag so that only on a socket **reconnect** it invalidates the `root-sidebar-pages` and `sidebar-pages` query keys (first connect must NOT invalidate). **Gap:** untested; the project has no socket/provider test harness yet. **Needed:** if a fake-socket/provider harness is feasible (Vitest, like the provider tests added in this PR), mount `UserProvider` with a stubbed socket + queryClient, emit `connect` twice, and assert `invalidateQueries` fires only on the second connect, for both keys. _Found in code review of PR #101._
Ghost added the test label 2026-06-21 05:05:39 +03:00
Ghost closed this issue 2026-06-21 14:10:36 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: vvzvlad/gitmost#106