mirror of
https://github.com/hoppscotch/hoppscotch.git
synced 2026-04-25 08:45:58 +03:00
[PR #5989] fix(realtime): track manual vs server-initiated disconnects #5447
Labels
No labels
CodeDay
a11y
browser limited
bug
bug fix
cli
core
critical
design
desktop
discussion
docker
documentation
duplicate
enterprise
feature
feature
fosshack
future
good first issue
hacktoberfest
help wanted
i18n
invalid
major
minor
need information
need testing
not applicable to hoppscotch
not reproducible
pull-request
question
refactor
resolved
sandbox
self-host
spam
stale
testmu
wip
wont fix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/hoppscotch#5447
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/hoppscotch/hoppscotch/pull/5989
Author: @mahmoodhamdi
Created: 3/13/2026
Status: 🔄 Open
Base:
main← Head:fix/realtime-disconnect-manual-flag📝 Commits (2)
99d9001fix(realtime): track manual vs server-initiated disconnectscd90fb9fix(realtime): avoid setting manualDisconnect in error handler📊 Changes
3 files changed (+14 additions, -7 deletions)
View changed files
📝
packages/hoppscotch-common/src/helpers/realtime/SIOConnection.ts(+6 -2)📝
packages/hoppscotch-common/src/helpers/realtime/SSEConnection.ts(+3 -3)📝
packages/hoppscotch-common/src/helpers/realtime/WSConnection.ts(+5 -2)📄 Description
Description
Closes #5987
Socket.IO, WebSocket, and SSE connections all hardcode
manual: trueon disconnect/stop events, making it impossible for the UI to distinguish between user-initiated disconnects and unexpected server-side connection drops.MQTT already handles this correctly with a
manualDisconnectflag — this PR brings the same pattern to the other three realtime protocols.Changes
SIOConnection.ts & WSConnection.ts:
private manualDisconnect = falseflagtrueonly in the user-facingdisconnect()methodSSEConnection.ts:
manualparameter tostop()(defaults totruefor backward compatibility with the existing UI callsse.value.stop())this.stop(false)to correctly mark error-triggered stops as non-manualTesting
MQTTConnection.tsSummary by cubic
Fixes realtime disconnect events to correctly flag user-initiated vs server-side drops, so the UI can distinguish intentional disconnects from unexpected failures. Aligns
Socket.IO,WebSocket, andSSEwith the existing MQTT pattern.manualDisconnect; set only indisconnect(), read/reset in the close handler; error handlers now close sockets directly without toggling the flag.stop(manual = true); internal error path callsstop(false)to mark non-manual stops.stop()behavior unchanged for existing UI calls.Written for commit
cd90fb9958. Summary will update on new commits.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.