Skip to content

fix: add WebRTC timeouts and fix auth/Apollo error handling#264

Merged
lukepolo merged 1 commit intomainfrom
audit/388-webrtc-lifecycle
Apr 9, 2026
Merged

fix: add WebRTC timeouts and fix auth/Apollo error handling#264
lukepolo merged 1 commit intomainfrom
audit/388-webrtc-lifecycle

Conversation

@Flegma
Copy link
Copy Markdown
Contributor

@Flegma Flegma commented Apr 8, 2026

Summary

  • Webrtc.ts: Add 10s timeouts to connect() and createPeer() promises to prevent indefinite hangs. Remove unnecessary async keyword from createPeer. Destroy peer on error before rejecting.
  • AuthStore.ts: Replace new Promise(async (resolve) => {...}) anti-pattern with proper async/await to prevent swallowed rejections
  • apollo.client.ts: Change return to continue in auth error handling so other GraphQL errors in the same response are still processed

Closes 5stackgg/5stack-panel#388, 5stackgg/5stack-panel#389, 5stackgg/5stack-panel#390

Test plan

  • Verify latency checks timeout after 10s instead of hanging indefinitely
  • Verify WebRTC peer creation times out and cleans up on failure
  • Verify auth flow works correctly after login/logout cycles
  • Verify non-auth GraphQL errors still show toast notifications

…rror handling

Webrtc.ts: Add 10s timeouts to data channel open and peer connection
promises. Remove unnecessary async from createPeer. Destroy peer on
error. AuthStore.ts: Replace async Promise constructor with proper
async/await. apollo.client.ts: Use continue instead of return so auth
errors don't prevent other error handling.
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.

[Web] WebRTC connection lifecycle — missing timeout, aggressive cleanup, orphaned connections

2 participants