vanita5 / mastodon-api

Mastodon API Client Library
MIT License
122 stars 21 forks source link

Not deleting heartbeats makes stream parsing fail #3

Closed IvanSanchez closed 7 years ago

IvanSanchez commented 7 years ago

The current parsing algorithm means that if a couple of heartbeats are received, and then a update event is received, the value of chunk will be something like

:thump
:thump
event: update
data: {...}

But then, the check for the heartbeat is applied to the whole chunk of data, and for the case described just above, the behaviour is to ignore the whole payload.

vanita5 commented 7 years ago

Thank you very much for reporting this issue and the pull request! :)

IvanSanchez commented 7 years ago

You're welcome :-D And thanks for this library, which is an important part of a project of mine (https://gitlab.com/IvanSanchez/soclial)

vanita5 commented 7 years ago

nice, I'll definietly check it out! :) I wrote a Twitter CLI and already thought about supporting Mastodon and Gnu social https://github.com/vanita5/birdknife

IvanSanchez commented 7 years ago

Wait, are you a former TTYtter user too? :-D

vanita5 commented 7 years ago

yes, of course :D and when TTYtter started to be annoying thanks to new Twitter features I thought it'd be fun to write a Twitter CLI by myself.