substance / notes

Real-time collaborative notes editing.
Other
21 stars 5 forks source link

Many websocket reconnects happening #105

Closed michael closed 7 years ago

michael commented 8 years ago

@Integral maybe you can find out if the server is crashing and restarting.

Integral commented 8 years ago

nothing like this server only prints CollabServer.onDisconnect someuuid

Integral commented 8 years ago

after reconnect cursor stays where it was before, but with loosed focus

obuchtala commented 8 years ago

I think nginx is closing idle connections - by default after 30s. While we could increase this, we still should add some keep-alive-pinger to our WebSocket wrapper.

Integral commented 8 years ago

Yes, looks like it's happening every 60s. So we need something like handshacking which we are doing on connect. Like giving five every minute. ;)

obuchtala commented 8 years ago

Yeah! HighFiving all the time is good way of looking at it ;)

Integral commented 8 years ago

@michael could you do this? I'm not sure that I know where is the best place to do that

michael commented 8 years ago

I think we could have a simpler setup without nginx, where we just expose node.js on port 80. We can then not host other apps on the same server but I think that's a good thing. I mean just to have one app per server so they are easier to maintain, and separately.

michael commented 8 years ago

I think i will start with a new Digital Ocean droplet and once we have it up we can turn off the old one.

@Integral did you have time to look into #110 ?

Integral commented 8 years ago

@michael I didn't look there yet. But could do it. Regarding issue. We could do what you proposed, but it will not solve a general problem. I mean there is a lot of reasons for using nginx (maybe not in this case). So it should be generally supported by our protocol.

obuchtala commented 8 years ago

Agree

michael commented 8 years ago

I create an issue for that in Substance to solve this generally.

Integral commented 8 years ago

What is really drive me mad is that after reconnection you always find yourself on beginning of a note.

michael commented 8 years ago

Think that's a component bug that is already resolved but will come with other stuff in isolated-nodes branch.

Integral commented 8 years ago

Fix gracefully by @michael! Yey!

Integral commented 8 years ago

I've noticed strange thing... After waking up computer notes going into weird loop of connections. It will connect and disconnect every five seconds. From browser logs: CollabClient connected CollabClient disconnected websocket connection closed. Attempting to reconnect in 5s.

Integral commented 8 years ago

Strange, but looks like I actually lost one paragraph of writing after this thing happened. Paragraph was written before.

Integral commented 8 years ago

I'm very disappointed... Just lost an hour of writing. Without any errors... It's just gone after refresh... Fuck it. Also I downloaded sqlite db to check and found that there are no snapshots in our db...

Integral commented 8 years ago

Wow. Again. It's just don't save anything. Without any errors.

michael commented 8 years ago

It seems like saving / also realtime syncing is completely broken now in the deployed version. Is it the same when running it locally? Maybe we should roll back to the old version until i have time to look into it. I'm busy with another big task right now.

Please don't write critical docs with Notes yet. At least do reloads every few minutes to ensure things are really saved.

Integral commented 7 years ago

Let's close this issue. Heartbeat did a thing, but reconnects could happen just because of any server error.