You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Mastodon's [POST] /inbox endpoint returns 202 Accepted when provided to parameter in a Note is invalid. It's not something really important, but if someone else runs into this problem it may be a good idea to double-check this param.
Related issue that kinda mentions it but not really: #8328
Only very superficial checking is done synchronously when receiving an activity (basically, is the request signed, is it a valid json, does it look like ActivityStreams), the actual processing (and more advanced checking) is performed in a worker, so the results cannot be reflected by the response's status code.
I guess we could perform checks before queuing the job and returning a status code, but I'm not completely sure this is worth splitting the processing code that way.
I also find this behavior confusing although 202 seems to be totally accurate ("request has been accepted for processing, but the processing has not been completed").
I ran into this when accepting a Follow activity (from a relay). A relay will accept but if the payload is wrong (ie the original Follow activity) then the relay will not know that the Mastodon instance could not accept the Accept. It puts a lot of responsibility on the sender to get things right (and on the communication between the admins of sender and recipient if users notice that something is wrong).
I would probably expect a HTTP 4** if the Accept is syntactically/semantically incorrect. Given that I am not familiar how complex the change would be, I do not have a strong opinion though.
In general, the 202 status makes it very hard to debug what you are doing wrong when building an ActivityPub app. You probably made a mistake but without any error responses you don't know where the problem might be.
Expected behaviour
4XX error
Actual behaviour
202 Accepted
Steps to reproduce the problem
Mastodon's
[POST] /inbox
endpoint returns202 Accepted
when providedto
parameter in aNote
is invalid. It's not something really important, but if someone else runs into this problem it may be a good idea to double-check this param.Related issue that kinda mentions it but not really: #8328
Simple request that returns 202:
Specifications
Mastodon v3.4.1 (latest live on mastodon.social)
The text was updated successfully, but these errors were encountered: