v3.0.3: cap socket.io reconnects + monitor cleanup on terminal failure#66
Merged
Merged
Conversation
Defense-in-depth on top of v3.0.2's websocket-only fix. Three changes: @pryv/socket.io - io() now passes reconnectionAttempts: 10, reconnectionDelayMax: 60000, randomizationFactor: 0.5. socket.io-client defaults are infinite attempts at <=5s — one stuck client could drive ~17k req/day per tab. With these settings the client gives up after ~10 attempts spread over ~1 minute. - New 'reconnect_failed' listener tears down the underlying _io and emits 'error' so consumers can clean up instead of leaving a zombie socket reference. @pryv/monitor - UpdateMethod/Socket.js error handler now drops this.socket if the underlying _io has been torn down. A future Changes.READY will rebuild from scratch instead of short-circuiting on the dead handle. Plus npm audit fix (non-breaking) — 15 → 5 vulnerabilities (the remaining 5 need --force / major version bumps in dev deps; out of scope for this PR).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Defense-in-depth on top of v3.0.2's websocket-only fix. Three changes:
@pryv/socket.io
io()now passesreconnectionAttempts: 10,reconnectionDelayMax: 60000,randomizationFactor: 0.5. socket.io-client defaults are infinite attempts at ≤5s — one stuck client could drive ~17k req/day per tab. With these settings the client gives up after ~10 attempts spread over ~1 minute.reconnect_failedlistener tears down the underlying_ioand emitserrorso consumers can clean up instead of leaving a zombie socket reference.@pryv/monitor
UpdateMethod/Socket.jserror handler now dropsthis.socketif the underlying_iohas been torn down. A futureChanges.READYwill rebuild from scratch instead of short-circuiting on the dead handle.Other
npm audit fix(non-breaking) — 15 → 5 vulnerabilities. The remaining 5 need--force/ major version bumps in dev deps; out of scope for this PR.Tests:
just test pryv-socket.io(10 pass),just test pryv-monitor(24 pass).Validated end-to-end by publishing v3.0.3 to npm and bumping consumers; no regression observed in production deployment.