Skip to content

Conversation

@WA11AX
Copy link
Owner

@WA11AX WA11AX commented Aug 10, 2025

Summary

  • avoid Node-specific timer type in WebSocket hook
  • clear reconnection timers when socket opens or component unmounts

Testing

  • npm test
  • npm run type-check
  • npm run lint:check (fails: ESLint couldn't find the config "@typescript-eslint/recommended")

https://chatgpt.com/codex/tasks/task_e_6898395dfe6c83278583bf5e52ee0151

Copilot AI review requested due to automatic review settings August 10, 2025 06:24
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes type compatibility issues in the WebSocket hook to ensure it works correctly in both browser and Node.js environments. The changes address timer type mismatches and improve timeout cleanup behavior.

  • Replace Node-specific NodeJS.Timeout type with browser-compatible ReturnType<typeof setTimeout>
  • Enhance timeout cleanup by setting the ref to null after clearing timers
  • Add comprehensive comments explaining the cross-environment compatibility approach

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants