67P / hyperchannel

Kosmos Chat for the Web
Mozilla Public License 2.0
20 stars 3 forks source link

Modifications for latest Sockethub #192

Closed galfert closed 4 years ago

galfert commented 4 years ago

Continuation of #181, but based on latest changes in Hyperchannel master.

raucao commented 4 years ago

Unfortunately, this doesn't work on my machine, with both Freenode IRC and an XMPP account:

The IRC connection is closed shortly after it has been established and the rooms have been joined:

  sockethub:platform:irc:Ittffkbq70ggEohU unprocessed irc message:> :cherryh.freenode.net 366 hyper_rau #kosmos-random :End of /NAMES list. +0ms
  sockethub:resource-manager flagging for termination platform instance Ittffkbq70ggEohU (no registered sockets found) +45s
  sockethub:resource-manager sockets: 0 instances: 1 +15s
  sockethub:resource-manager terminating platform instance Ittffkbq70ggEohU (flagged for termination: no registered sockets found) +0ms
  sockethub:platform:irc:Ittffkbq70ggEohU cleanup() called +16s
  sockethub:platform:irc:Ittffkbq70ggEohU irc client 'close' event fired. +137ms
  sockethub:worker:yQbDprtvgxRqNv-_AAAB caught platform domain error: Error: connection to server closed.
  sockethub:worker:yQbDprtvgxRqNv-_AAAB     at __forceDisconnect (/home/basti/src/sockethub/sockethub/node_modules/sockethub-platform-irc/index.js:589:11)

Something similar (probably the same) happens with XMPP. The connection is closed pretty much immediately after it has been established. But for XMPP none of the channel content or names show up in Hyperchannel, while for IRC it disconnects, but the space and channels all still show as connected.

  sockethub:platform:xmpp:uQ8kpRUJcXA3nek2 close received for sebastian@5apps.com/hyperchannel +489ms                                                                        
  sockethub:worker:yQbDprtvgxRqNv-_AAAB caught platform domain error: Error: received close event for sebastian@5apps.com/hyperchannel
  sockethub:worker:yQbDprtvgxRqNv-_AAAB     at EventEmitter.close (/home/basti/src/sockethub/sockethub/node_modules/sockethub-platform-xmpp/index.js:569:15)

Edit: I'm on a 4G connection, which is pretty fast but does have a modicum of packet loss (around 5%). It should definitely be good enough for keeping up IRC and XMPP connections, but maybe this info helps anyway.

galfert commented 4 years ago

I can't reproduce this and have no idea what's going on there. Maybe @silverbucket has an idea?Also would be good if he and @gregkare can give it a try to see if it works for them.

raucao commented 4 years ago

@galfert I can easily reproduce this when starting from clean local storage. Just choose nickname for IRC, it connects and works. As soon as you add the 5apps XMPP space it breaks.

gregkare commented 4 years ago

I'm going to give this one a shot

gregkare commented 4 years ago

Yup, I can reproduce this, as soon as I add the 5apps XMPP space it disconnects my connection to Freenode

raucao commented 4 years ago

I remember this being the case in the past at some point. IIRC it was before 3.0.

galfert commented 4 years ago

I tested with the Kosmos XMPP server and everything worked fine.

Just tested with the 5apps server and got the same problem. Found the reason to be a wrong port number in the preset setting (5223 instead of 5222). Fixed the port number and now it works.

I also added a preset for the Kosmos XMPP server.

raucao commented 4 years ago

Great, thanks!

But this means that there's both a bug in Sockethub (it shouldn't disconnect other platforms just because one of them fails to connect), as well as missing error handling for connections in Hyperchannel. So we need GitHub issues for both of those.

Also, I didn't change anything about ports between developing things on master and testing this branch. Meaning something changed about that port config working or being used in the first place. (I used the saved config from RS, which was working on master.)

raucao commented 4 years ago

Tested again, and now I don't see disconnects anymore. However, XMPP incoming and outgoing MUC messages still don't work for me. I did see the incoming messages from the server in master before, but also only the ones it sends upon joining, not normal ones.

Not sure if that means something is still broken, or if that's simply because the XMPP support isn't there yet.

raucao commented 4 years ago

@galfert Did you see my question?

Not sure if that means something is still broken, or if that's simply because the XMPP support isn't there yet.

galfert commented 4 years ago

I don't know, but I think it's a problem of the Sockethub XMPP implementation rather than a problem on the client.

I just was able to reproduce the problem, where I joined a channel but couldn't receive or send any messages. And the Sockethub logs didn't show anything, no errors but also no events for e.g. receiving messages.

After I restarted Sockethub, it worked again.

raucao commented 4 years ago

How should we proceed here? I also don't get messages in master most of the time, so I think it's not a new issue.

When we merge this, we also have to deploy latest Sockethub in production btw.

raucao commented 4 years ago

@galfert Can you update this with the new release as a dev dependency, and an npm script for running it, as you proposed elsewhere?

galfert commented 4 years ago

Sure.

galfert commented 4 years ago

Can you update this with the new release as a dev dependency, and an npm script for running it, as you proposed elsewhere?

Done.

raucao commented 4 years ago

@galfert Did you actually try this? It's missing all the dependencies that contain the client libraries for me (activity-streams, socket.io-client etc.).

Edit: opened sockethub/sockethub#255 about it.

galfert commented 4 years ago

I only tested if the server started without errors. Haven't opened Hyperchannel.

raucao commented 4 years ago

I opened #201 about the dependency issue and merged this one, so we can continue work here with the latest Sockethub.