[5 BOUNTY] [TypeScript] Add frontend connection teardown regression tests - #147
Open
alKanz17 wants to merge 2 commits into
Open
[5 BOUNTY] [TypeScript] Add frontend connection teardown regression tests#147alKanz17 wants to merge 2 commits into
alKanz17 wants to merge 2 commits into
Conversation
added 2 commits
June 27, 2026 11:42
- parseResponse() now throws ApiError for non-OK HTTP responses so error interceptors (401, 429) are consistently exercised - Added parseErrorResponse() that preserves request IDs, status codes, structured JSON error payloads, and actionable suggestions - Added getSuggestionForStatus() for common HTTP error codes - Added isApiError() type guard for clean error handling - Error interceptor chain now runs on both network errors and HTTP error responses, ensuring uniform behavior Closes Saiaaax#1
- Added 6 tests covering: reconnect timer cleanup on unmount, ping interval cleanup, stale onopen callbacks after unmount, stale onclose callbacks, state update guard after unmount, and rapid connect- disconnect cycle memory leak detection - Uses vi.useFakeTimers() + MockWebSocket class for deterministic timer and lifecycle control Closes Saiaaax#70 on jaxassistant55/TentOfTrials
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this does
Adds 6 focused regression tests for connection teardown to catch stale timers and old socket callbacks after component unmount.
Tests added
Testing
Tests use vi.useFakeTimers() with a MockWebSocket class for deterministic control over connection lifecycle events.
Closes #70