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

XEP-0198 Stream Management #316

Closed
jcbrand opened this issue Feb 8, 2015 · 16 comments

Comments

@jcbrand
Copy link
Member

commented Feb 8, 2015

We can now use websockets in converse.js (see #204).

Unfortunately the keepalive setting doesn't work with websockets because xmpp-over-websockets doesn't use the same session token as BOSH does.

It looks like XEP-0198 solves this issue, specifically the section about "stream resumption".


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@jcbrand jcbrand added the Feature label Feb 8, 2015

@chihanlin

This comment has been minimized.

Copy link

commented Mar 9, 2015

Indeed, XEP-0198 is very important in term of "making" instant message become a reliable communication tool. The newer version of Ejabberd server support this. This new enhancement should be in a higher priority among all.

@johnsmith138813

This comment has been minimized.

Copy link

commented May 31, 2018

Reliable communication is an important part of any messaging system.

This ticket is about XEP-0198 Stream Management, which brings much needed reliability to xmpp.

This ticket should NOT be closed, as I do not see commit 3514d6d addressing this issue ?

strophejs already has a plugin for XEP-0198

@jcbrand

This comment has been minimized.

Copy link
Member Author

commented May 31, 2018

Looks like the commit wrongly referenced (and closed) this ticket.

Some work has already been done in the xep-0198 branch. I'm purposefully not using Strophe plugins since they're often incomplete and generally too low-level.

@jcbrand jcbrand reopened this May 31, 2018

@jcbrand jcbrand added this to the 4.0.0 milestone May 31, 2018

@johnsmith138813

This comment has been minimized.

Copy link

commented May 31, 2018

I see.

Thanks for the quick update!

@jcbrand jcbrand modified the milestones: 4.0.0, 4.0.1 Sep 7, 2018

@jcbrand jcbrand modified the milestones: 4.0.1, 4.0.2 Sep 22, 2018

@jcbrand jcbrand removed this from the 4.0.2 milestone Oct 3, 2018

jcbrand added a commit that referenced this issue Oct 10, 2018
jcbrand added a commit that referenced this issue Oct 10, 2018
jcbrand added a commit that referenced this issue Oct 10, 2018
jcbrand added a commit that referenced this issue Oct 10, 2018
jcbrand added a commit that referenced this issue Oct 27, 2018
jcbrand added a commit that referenced this issue Oct 27, 2018
jcbrand added a commit that referenced this issue May 24, 2019
jcbrand added a commit that referenced this issue May 24, 2019
jcbrand added a commit that referenced this issue May 24, 2019
jcbrand added a commit that referenced this issue May 24, 2019
jcbrand added a commit that referenced this issue May 24, 2019
jcbrand added a commit that referenced this issue May 24, 2019
jcbrand added a commit that referenced this issue May 26, 2019
jcbrand added a commit that referenced this issue May 29, 2019
Initial work on adding support for XEP-0198
Rename session cache id from `converse.bosh-session` to `converse.session`
since we're not only storing BOSH info there.

Updates #316
jcbrand added a commit that referenced this issue May 30, 2019
Initial work on adding support for XEP-0198
Rename session cache id from `converse.bosh-session` to `converse.session`
since we're not only storing BOSH info there.

Updates #316
jcbrand added a commit that referenced this issue May 30, 2019
Initial work on adding support for XEP-0198
Rename session cache id from `converse.bosh-session` to `converse.session`
since we're not only storing BOSH info there.

Updates #316
jcbrand added a commit that referenced this issue May 30, 2019
Initial work on adding support for XEP-0198
Rename session cache id from `converse.bosh-session` to `converse.session`
since we're not only storing BOSH info there.

Updates #316
jcbrand added a commit that referenced this issue May 30, 2019
Add support for XEP-0198 Stream Management
Rename session cache id from `converse.bosh-session` to `converse.session`
since we're not only storing BOSH info there.

Updates #316
jcbrand added a commit that referenced this issue May 30, 2019
Add support for XEP-0198 Stream Management
Rename session cache id from `converse.bosh-session` to `converse.session`
since we're not only storing BOSH info there.

Updates #316
jcbrand added a commit that referenced this issue May 31, 2019
Add support for XEP-0198 Stream Management
Rename session cache id from `converse.bosh-session` to `converse.session`
since we're not only storing BOSH info there.

Updates #316
jcbrand added a commit that referenced this issue May 31, 2019
Add support for XEP-0198 Stream Management
- New plugin `converse-smacks`
- New config option `enable_smacks`
- Rename session cache id from `converse.bosh-session` to `converse.session`

Updates #316
jcbrand added a commit that referenced this issue May 31, 2019
Add support for XEP-0198 Stream Management
- New plugin `converse-smacks`
- New config option `enable_smacks`
- Rename session cache id from `converse.bosh-session` to `converse.session`

Updates #316
jcbrand added a commit that referenced this issue May 31, 2019
Add support for XEP-0198 Stream Management
- New plugin `converse-smacks`
- New config option `enable_smacks`
- Rename session cache id from `converse.bosh-session` to `converse.session`

Updates #316
jcbrand added a commit that referenced this issue May 31, 2019
Add support for XEP-0198 Stream Management
- New plugin `converse-smacks`
- New config option `enable_smacks`
- Rename session cache id from `converse.bosh-session` to `converse.session`

Updates #316
jcbrand added a commit that referenced this issue May 31, 2019
Add support for XEP-0198 Stream Management
- New plugin `converse-smacks`
- New config option `enable_smacks`
- Rename session cache id from `converse.bosh-session` to `converse.session`

Updates #316
jcbrand added a commit that referenced this issue Jun 1, 2019
Add support for XEP-0198 Stream Management
- New plugin `converse-smacks`
- New config option `enable_smacks`
- Rename session cache id from `converse.bosh-session` to `converse.session`

Updates #316
jcbrand added a commit that referenced this issue Jun 1, 2019
Add support for XEP-0198 Stream Management
- New plugin `converse-smacks`
- New config option `enable_smacks`
- Rename session cache id from `converse.bosh-session` to `converse.session`
- Refactor logout and login as consistently used api methods
- Refactor session cache to store per JID

Updates #316
jcbrand added a commit that referenced this issue Jun 2, 2019
Add support for XEP-0198 Stream Management
- New plugin `converse-smacks`
- New config option `enable_smacks`
- Rename session cache id from `converse.bosh-session` to `converse.session`
- Refactor logout and login as consistently used api methods
- Refactor session cache to store per JID

Updates #316
jcbrand added a commit that referenced this issue Jun 3, 2019
Add support for XEP-0198 Stream Management
- New plugin `converse-smacks`
- New config option `enable_smacks`
- Rename session cache id from `converse.bosh-session` to `converse.session`
- Refactor logout and login as consistently used api methods
- Refactor session cache to store per JID

Updates #316
jcbrand added a commit that referenced this issue Jun 3, 2019
Add support for XEP-0198 Stream Management
- New plugin `converse-smacks`
- New config option `enable_smacks`
- Rename session cache id from `converse.bosh-session` to `converse.session`
- Refactor logout and login as consistently used api methods
- Refactor session cache to store per JID

Updates #316

@jcbrand jcbrand closed this in 7b11d85 Jun 3, 2019

@licaon-kter

This comment has been minimized.

Copy link
Contributor

commented Jun 4, 2019

enable_smacks: true but I don't see any stream info server site, eg. like I see for Conversations users.

How do I know that it works?

@jcbrand

This comment has been minimized.

Copy link
Member Author

commented Jun 4, 2019

Turn on debugging and then check the stanza traffic in your browser console. You can filter by sm:3 and should then see the relevant stanzas.

@licaon-kter

This comment has been minimized.

Copy link
Contributor

commented Jun 4, 2019

I can see <r /> and <a />, is that enough?

@jcbrand

This comment has been minimized.

Copy link
Member Author

commented Jun 4, 2019

Pretty much, you can also check that resumed is received when you reload the page.

@licaon-kter

This comment has been minimized.

Copy link
Contributor

commented Jun 4, 2019

I don't think I ever saw Converse recover from a reload (not FORCE reload), hit F5 or the reload button and I need to login again. Was this fixed?

@jcbrand

This comment has been minimized.

Copy link
Member Author

commented Jun 4, 2019

I test it with auto_login.

Alternatively, if you have a newer browser, it should also have the CredentialsContainer API which can help.

I added support for that yesterday or so.

In my case, I need to choose the login JID every time (because I have multiple credentials saved for the site), but I don't have to give the password.

@licaon-kter

This comment has been minimized.

Copy link
Contributor

commented Jun 4, 2019

I can't enable that auto-login.

Yes, I run HEAD so I can save the credentials, so it's nicer, not seamless yet. For that I guess that the "storage thing" branch needs to be merged.

@laszlovl

This comment has been minimized.

Copy link
Contributor

commented Jun 16, 2019

Is there a reason not to enable enable_smacks by default? Any downsides to using it?

I can't get Converse (current master) to reattach the previous session when refreshing the browser. It throws a " ERROR: Websocket closed unexpectedly", " ERROR: _onIdle@dist/converse.js:42096:33" then back to the login page. The same thing works well with BOSH.

@laszlovl

This comment has been minimized.

Copy link
Contributor

commented Jun 16, 2019

If I kill my computer's internet for a minute, Converse does reconnect without dropping back to the login page, but it looks like it's doing a full reconnect instead of a resume. Server is Ejabberd 19.05.

Firefox can’t establish a connection to the server at wss://bosh/ws. websocket.js:159
 ERROR: Websocket error [object Event] converse-core.js:269:15
 2019-06-16T17:00:03.926Z INFO: Status changed to: CONNFAIL converse-core.js:280:19
 2019-06-16T17:00:03.926Z DEBUG: _doDisconnect was called converse-core.js:278:19
 2019-06-16T17:00:03.927Z DEBUG: WebSockets _doDisconnect was called converse-core.js:278:19
 2019-06-16T17:00:03.927Z INFO: Status changed to: DISCONNECTED converse-core.js:280:19
 2019-06-16T17:00:05.929Z INFO: RECONNECTING: the connection has dropped, attempting to reconnect. converse-core.js:280:19
 2019-06-16T17:00:05.947Z INFO: Status changed to: CONNECTING converse-core.js:280:19
 2019-06-16T17:00:17.387Z DEBUG: Websocket open converse-core.js:278:19
 2019-06-16T17:00:17.390Z DEBUG: <open to="domain.com" version="1.0"/> converse-core.js:278:19
 2019-06-16T17:00:17.412Z DEBUG: <open xmlns="urn:ietf:params:xml:ns:xmpp-framing" id="17551277455572275782" version="1.0" xml:lang="en" from="domain.com"/> converse-core.js:278:19
 2019-06-16T17:00:17.413Z DEBUG: _connect_cb was called converse-core.js:278:19
 2019-06-16T17:00:17.414Z DEBUG: <stream:features xmlns:stream="http://etherx.jabber.org/streams"><mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><mechanism>PLAIN</mechanism><mechanism>X-OAUTH2</mechanism></mechanisms></stream:features> converse-core.js:278:19
 2019-06-16T17:00:17.418Z DEBUG: <iq from="l@domain.com/converse.js-100272000" to="l@domain.com" type="get" id="9888f55d-5b2d-43bc-be5c-9a4e2b288d59:sendIQ"><query/></iq> converse-core.js:278:19
 2019-06-16T17:00:17.421Z DEBUG: <iq from="l@domain.com/converse.js-100272000" to="l@domain.com" type="get" id="e2bc77e9-6606-46db-aa96-cc67a4a9fabe:sendIQ"><query/></iq> converse-core.js:278:19
 2019-06-16T17:00:17.421Z DEBUG: <auth mechanism="PLAIN">bGFzemxvLnZhbi5sb25raHVpemVuQHVjLmZ1dHVyZS5jbXBkZXYuY29tAGxhc3psby52YW4ubG9ua2h1aXplbgBqRkZMSjluOWl3OQ==</auth> converse-core.js:278:19
 ERROR: WebSocket stream error: not-authorized converse-core.js:269:15
 2019-06-16T17:00:17.435Z INFO: Status changed to: ERROR converse-core.js:280:19
 2019-06-16T17:00:17.438Z DEBUG: _doDisconnect was called converse-core.js:278:19
 2019-06-16T17:00:17.440Z DEBUG: WebSockets _doDisconnect was called converse-core.js:278:19
 2019-06-16T17:00:17.440Z INFO: Status changed to: DISCONNECTED converse-core.js:280:19
 2019-06-16T17:00:17.442Z INFO: RECONNECTING: the connection has dropped, attempting to reconnect. converse-core.js:280:19
 2019-06-16T17:00:17.466Z INFO: Status changed to: CONNECTING converse-core.js:280:19
 2019-06-16T17:00:17.814Z DEBUG: Websocket open converse-core.js:278:19
 2019-06-16T17:00:17.815Z DEBUG: <open to="domain.com" version="1.0"/> converse-core.js:278:19
 2019-06-16T17:00:17.832Z DEBUG: <open xmlns="urn:ietf:params:xml:ns:xmpp-framing" id="18411630438168123806" version="1.0" xml:lang="en" from="domain.com"/> converse-core.js:278:19
 2019-06-16T17:00:17.833Z DEBUG: _connect_cb was called 
@jcbrand

This comment has been minimized.

Copy link
Member Author

commented Jun 17, 2019

What are these two IQ stanzas for?

2019-06-16T17:00:17.418Z DEBUG: <iq from="l@domain.com/converse.js-100272000" to="l@domain.com" type="get" id="9888f55d-5b2d-43bc-be5c-9a4e2b288d59:sendIQ"><query/></iq> converse-core.js:278:19
 2019-06-16T17:00:17.421Z DEBUG: <iq from="l@domain.com/converse.js-100272000" to="l@domain.com" type="get" id="e2bc77e9-6606-46db-aa96-cc67a4a9fabe:sendIQ"><query/></iq> converse-core.js:278:19

They shouldn't happen here, they should only get sent out after resumption.

Is this vanilla Converse or did you modify it in some way?

Firefox can’t establish a connection to the server at wss://bosh/ws. websocket.js:159

I don't get errors like this on FF.

@jcbrand

This comment has been minimized.

Copy link
Member Author

commented Jun 17, 2019

Is there a reason not to enable enable_smacks by default?

Conservatism. It's still new and might have bugs.

@laszlovl

This comment has been minimized.

Copy link
Contributor

commented Jun 17, 2019

It's a vanilla Converse, latest master as of 1 or 2 days ago. I think I will hold off on testing 0198 for a while yet and focus on other issues, but if you are interested in checking it out I can easily get you a test account on this Ejabberd instance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.