Skip to content

fix: clear heartbeat timeout on client disconnect#274

Merged
avoidwork merged 5 commits into
masterfrom
fix/clear-heartbeat-on-disconnect
May 19, 2026
Merged

fix: clear heartbeat timeout on client disconnect#274
avoidwork merged 5 commits into
masterfrom
fix/clear-heartbeat-on-disconnect

Conversation

@avoidwork
Copy link
Copy Markdown
Owner

@avoidwork avoidwork commented May 18, 2026

Summary

The CLOSE event handler on the HTTP request was missing this.stop(), leaving the heartbeat setTimeout alive after client disconnect and preventing garbage collection of the EventSource instance.

Type of Change

  • Bugfix (non-breaking change which fixes an issue)

Testing

Ran npm run build (lint + rollup) and npx mocha test/eventsource.js. All 9 tests pass including a new test verifying heartbeat stops on client disconnect.

Coverage

  • 100% line coverage maintained

Checklist

  • npm run lint passes
  • Tests pass with 100% line coverage
  • No forbidden patterns used
  • Conventional Commit style applied

@avoidwork avoidwork self-assigned this May 18, 2026
@avoidwork avoidwork merged commit a2cd010 into master May 19, 2026
3 checks passed
@avoidwork avoidwork deleted the fix/clear-heartbeat-on-disconnect branch May 19, 2026 00:06
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