bkad / prat

group chat with markdown served over websockets
11 stars 6 forks source link

Reconnection logic sometimes thinks it's behind when it isn't #66

Open cespare opened 11 years ago

cespare commented 11 years ago

Unfortunately I don't know how to repro this, but I witnessed the following bad behavior.

I had just typed a sequence of messages ("a", "b", "c"). The app was in such a state that when I shut of the server and the turned it back on, the client would think it missed a message and append "c" again. Every time I restarted the server, I would get another "c".

@bkad is this enough of a clue?

bkad commented 11 years ago

we figured this out: it was because i dropped and loaded the events collection from disk without making it capped again. Sorting by natural order to arrange messages in insertion order only works for capped collections.

cespare commented 11 years ago

No, this was on my machine.

bkad commented 11 years ago

is your app still in that state? i'd like to get my hands all up in it

cespare commented 11 years ago

No :( I was hoping you could guess from the description because it's no longer doing it. I'll let you know if I see it again.