Skip to content

Fix stale console snapshot overwriting tunnel state#58

Open
zsio wants to merge 2 commits into
mainfrom
investigate-web-tunnel-state-pending
Open

Fix stale console snapshot overwriting tunnel state#58
zsio wants to merge 2 commits into
mainfrom
investigate-web-tunnel-state-pending

Conversation

@zsio

@zsio zsio commented Jun 19, 2026

Copy link
Copy Markdown
Owner

Summary

  • Fix stale console snapshot responses overwriting newer tunnel_changed state in the web event stream cache
  • Track snapshot freshness per event-stream lifecycle and discard stale HTTP resync/SSE snapshots
  • Add frontend regression tests for stale snapshot ordering and strengthen server restore test for pending -> restored/exposed -> snapshot=exposed
  • Keep temporary tunnel/snapshot diagnostics enabled by default for investigation builds

Verification

  • cd web && bun test src/hooks/use-event-stream.test.ts
  • cd web && bun run build
  • cd web && bun run lint
  • go test ./internal/server -run TestUnifiedServerExposeProvisionAndDataHeaderUseStoredRevision -count=1
  • go test ./internal/server -count=1

zsio and others added 2 commits June 18, 2026 17:04
…ation test

Add env-gated diagnostic logging in backend (NETSGO_DEBUG_TUNNEL_EVENTS)
and frontend (localStorage netsgo:debug:event-stream) to trace tunnel
state propagation through SSE tunnel_changed and console snapshot resync.

Add use-event-stream.test.ts as a characterization test documenting the
race where an older console snapshot response can overwrite a newer
tunnel_changed optimistic update, leaving tunnel state stuck in pending.

Remove three obsolete review/notes docs.
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