Skip to content
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

Various missing information #1570

Closed
anosidium opened this issue Dec 6, 2024 · 5 comments
Closed

Various missing information #1570

anosidium opened this issue Dec 6, 2024 · 5 comments

Comments

@anosidium
Copy link

The documentation is missing some information.

Entity Notification, type attribute is missing annual_report string as part of its enumeration. I received a special annual report notification. It broke my client.

Likewise AnnualReport entity exists but the documentation does not list it.

As far as I was able to gather, it includes year attribute and an optional account attribute.

Also, entity NotificationGroup needs to include an optional annual_report attribute which I believe is an AnnualReport type.

@trwnh
Copy link
Member

trwnh commented Dec 6, 2024

See #1211 -- 4.3 "annual_reports" feature is on the list of undocumented things

@trwnh trwnh closed this as not planned Won't fix, can't repro, duplicate, stale Dec 6, 2024
@anosidium
Copy link
Author

How are clients supposed to guard against these undocumented APIs when they are received in the JSON response?

@trwnh
Copy link
Member

trwnh commented Dec 6, 2024

At the very least for the notifications API, several clients show a "notification of unknown type" item in their notification UIs. I would say that the notification handler could be thought of as a case-based structure:

  • If it's a mention, render a mention notification
  • If it's a favourite, render a favourite notification
  • ...
  • By default case, render a generic notification

@anosidium
Copy link
Author

Right but what about the content of the notification? As far as I have inspected, it doesn't provide a status to indicate what the notification actually is. It returns an account but there is no context provided. How do I inform the user that this notification is an annual report notification that they can view their report even if I were to display it as an unmarked notification?

@trwnh
Copy link
Member

trwnh commented Dec 7, 2024

You can generally expect a type and a created_at for now: https://github.com/mastodon/mastodon/blob/72a4da83fdd2ac8a089cde208149792108783d97/app/serializers/rest/notification_serializer.rb#L5

This could be rendered as a single line of text that says: "Unknown notification received: {type}"

If you're talking about how to handle notifications of type annual_report, then I think you're supposed to use GET /api/v1/annual_reports (and the notification is just to tell you that the report is ready).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants