-
Notifications
You must be signed in to change notification settings - Fork 153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support newer event type #234
Comments
Hi! I guess you mean this from the changelog:
And the crash is in the streaming API on receiving the update event? |
Hello @tribela I guess the "crash" is a MastodonMalformedEventError from this function (in streaming.py): def _dispatch(self, event):
...
handler_name = 'on_' + name
try:
handler = getattr(self, handler_name)
except AttributeError as err:
exception = MastodonMalformedEventError('Bad event type', name)
self.on_abort(exception)
six.raise_from(
exception,
err
)
else:
handler(payload) The I'll try to support @halcy to implement it. It may also be useful to configure Mastodon.py to ignore unknown events to avoid future problems with new events. With this option, a developer has the choice to use Mastodon.py with newer API events. |
I checked the code, and it's typically possible to write listener-functions to manage well-known new events. Unfortunately, Mastodon API use now a dot inside the event name. And this is not supported with the callback-function lookup. So, we have two cases:
For point 2 the solution is simple. The event-name can be patched to replace dots with underscores (we hope, we'll not get other special characters). The solution for the first point is just a little more complicated, but worth it if you want to prevent such current cases that Mastodon.py is not usable for a while when the API has changed. I implemented both solutions and check it, if it's working. I'll drop a PR. The PR will not include a handling of Supporting the new "status edit" should be part of an additional implementation. /cc @halcy |
See also: #218 |
Mastodon 3.5 introduces
status.update
event.Currently mastodon.py doesn't support it, And keep crashing on that event.
The text was updated successfully, but these errors were encountered: