Skip to content

import Node's setTimeout & clearTimeout to prevent ambiguity#632

Merged
darrachequesne merged 2 commits intosocketio:masterfrom
JeffWinder:master
Dec 14, 2021
Merged

import Node's setTimeout & clearTimeout to prevent ambiguity#632
darrachequesne merged 2 commits intosocketio:masterfrom
JeffWinder:master

Conversation

@JeffWinder
Copy link
Contributor

The kind of change this PR does introduce

  • a bug fix
  • a new feature
  • an update to the documentation
  • a code change that improves performance
  • other

Current behaviour

setTimeout in lib/socket.ts can lead to error this.pingIntervalTimer.refresh is not a function because interpreter might see it as the javascript version, which doesn't have a refresh() function.

New behaviour

Importing setTimeout and clearTimout from Node's timers module explicitly doesn't result in the error anymore.

Other information (e.g. related issues)

Solves the bug in this issue: #631
The refresh() call was added here #628

@darrachequesne darrachequesne merged commit b04967b into socketio:master Dec 14, 2021
@darrachequesne
Copy link
Member

@JeffWinder thanks!

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.

2 participants