Hacker News new | ask | show | jobs
by amstan 580 days ago
I tried to do something similar. It's infuriating how the client must be stateful and have local storage, for both the access_token and even last message recieved. That's right you must remember as the client where the last events [1] you've seen (even if you already told the server to mark it as read) was or else the server will happily send you the same messages over and over again.

I kind of miss making IRC bots where things were much simpler and ... quicker honestly (latency wise).

[1] https://uhoreg.gitlab.io/matrix-tutorial/sync.html#:~:text=w...

1 comments

At least that means that you will never have messages get dropped due to network issues, or even restarts if you persist the token across such. (the API will jump forwards if there are too many unsynced messages, but at least it should then be providing a "limited: true" so that one can paginate in the omitted events if so desired (or not if undesired))