Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stream-management: Implement requesting ACKs #1054

Open
wants to merge 42 commits into
base: main
Choose a base branch
from

Conversation

sonnyp
Copy link
Member

@sonnyp sonnyp commented Jan 15, 2025

See #1005

singpolyma and others added 30 commits January 7, 2025 12:01
Queue outgoing stanzas and periodically request ACK.  Remove from the
queue anything ack'd and notify of the ack so apps can know the stanza
has for sure sent.

On resume, anything not ack'd is re-sent.  On reconnect, anything not
ack'd notify of the failure to send this stanza so apps can know the
stanza failed.

Even when there is no traffic, send an <r/> at least every 5 minutes to check the
connection.  If there is no inbound traffic (such as an <a/>) within
timeout (default 60 seconds) then consider the connection disconnected.
Store the stamp seperately in the queue and then add it the first time
we retry.  Saves some work and a dependency.
Needs to use force-disconnect especially if we emulate an issue using pause
Users keep using it expecting it to be a public method even though it is not documented

* #1013
* b25e478
* #974

I guess that's fair, I'll create a new `disconnect` method that is safe to use.
sonnyp added 11 commits January 15, 2025 13:12
* Simplify code
* Support EventTarget and EventEmitter
And improve `sendMany` for WebSocket
Also add connection.isSecure() method

Fixes #1040
This helps in case the socket is proxied (eg WebWorker)
At least on the web, emitting an error on fast will stop processing.
Unless there is an error event listener on it but adding error listener on all "plugins" is a bit cumbersome.
So let's always emit errors on entity instead.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants