Currently there's nothing to handle an error from Prosody in the body of a 200 response
I'm updating DjangoLDP to store response bodies on activities (see !33 (merged) ), but it will still look like a success in the list view of the admin panel
We will want to define some code to log an error to sentry when there is an error in the response
Tasks
ActivityQueue will need to provide support for a callback function for our package: djangoldp#283 (closed)
I'll need to know what a Prosody 200 error looks like
With these, we can schedule a callback which just logs an error to the Sentry server
Designs
Child items
...
Show closed items
Linked items
0
Link issues together to show that they're related.
Learn more.
@MattJ will be able to tell you the format he chose.
Usually those errors come when you save a Circle, Prosody register it and one or more of its members is a 404 (or any other error code) and is ignored. Meaning that "Yeah, your circle is created/saved/usable, but no, the integrity of the member list is not here."
@MattJ What if you have an error but still, it's a 200?
Say a circle creation, but one of its members does not exists. It must be a 200 OK because the circle is created properly, just one of its members does not exist.
The circle is successfully saved, the missing member is ignored.
This is because those kind of request are made on two-or-more steps:
Create the circle
Affiliate its members
The second part lead to sub-requests for each members, but it's not the responsibility of the server who host the circle to ensure that every users of distant servers exists properly and that their server is reachable, without any network issue, etc.
When a member does not exist, the request is still successful as the circle exist and, potential other members are in.
Prosody applies changes for all members that it can. If a member fails (for any reason) the error is caught and saved and it continues.
After all members are processed in this way, if the number of saved errors >0 then each error gets logged, and Prosody will respond with an error instead of success to Django.
Problem here is if the user is a 404 and you return a 500 to Django, Django may simply retry 2 more times to re-send you the request and then consider that it was a failure.
I currently avoid leaking any potentially private info via the error responses (as it is not authenticated in any way). The details are logged in Prosody's log (which would be sent to Sentry), and they include the change id for correlation purposes.