42wim / matterircd

Connect to your mattermost or slack using your IRC-client of choice.
MIT License
294 stars 60 forks source link

feature request: keep state on last seen messages #313

Closed Peter4825 closed 3 years ago

Peter4825 commented 4 years ago

When disconnected from matterircd, messages may still pour in. When reconnecting to matterircd, it would make sense for matterircd to replay all messages that have been missed in the meanwhile.

Matterircd currently replays some messages, but this may be incomplete - when we've been offline for more then a few messages there might be a gap, or might have duplicates: messages we've already seen might be shown again

It would make sense for matterircd to optionally keep state, ie a file with the contents user X on server Y protocol Z has seen messages until timestamp 999999 so matterircd could replay exactly what has been missing...

hloeung commented 3 years ago

Matterircd currently replays some messages, but this may be incomplete - when we've been offline for more then a few messages there might be a gap, or might have duplicates: messages we've already seen might be shown again

Likely something is updating the Mattermost channel viewed (updateat?) which matterircd uses to replay old messages. This is why there might be gaps. As for duplicates, that's likely because https://github.com/42wim/matterircd/issues/245#issuecomment-674564178

I have a PR open to keep an internal state on what we've seen. It doesn't yet make it persistent dumping out to disk (and load) so is lost on matterircd restarts.

Feedback and additional testing welcome!

hloeung commented 3 years ago

https://github.com/42wim/matterircd/pull/368

42wim commented 3 years ago

Fixed by @hloeung