-
Notifications
You must be signed in to change notification settings - Fork 333
Document federation errors #1674
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple of minor suggestions are inlined.
CHANGELOG.md
Outdated
@@ -61,6 +61,7 @@ Upgrade nginz (#1658) | |||
|
|||
## Federation changes (alpha feature, do not use yet) | |||
|
|||
* Added documentation of federation errors (#1674). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a federation-api-backwards-incompatible change (since router.proto changes), which is fine right now, but we'd need to be more careful about this in the future. Could be added to the changelog like here: https://github.com/wireapp/wire-server/blob/develop/CHANGELOG.md#internal-federation-api-changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we had kept the existing field indices, then I think this sort of change should be backwards compatible. Is this right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, if the meaning and the numbers stay, but only things are added, it's backwards compatible. If indices change or are removed it's not.
So far so good, no need for backwards compatibility concerns just yet.
Thanks for approving @jschaul. I marked this PR as a draft, because I wanted to use it to work on reorganising the error codes and clean up error handling. Should I instead merge it as is, and do that in a separate PR? |
As you wish, I think this is not urgent to get merged, so feel free to keep it around and organize errors a but differently first. Whatever is more convenient. Another thought crossed my mind: I noticed when doing a manual test that currently the behaviour of the webapp on a 400 (federation not allowed) is, they stop. And on the 525 errors, the webapp retried the request about 10 times. So I wonder if there should be some guidance we can give on these different errors about what e.g. the client could do (retry later, or not), or what the user could do. Some of this discussion could happen with involvement of more parties, but some things could also be added to the description perhaps. |
Good point, I added it as a TODO item. |
eea86a8
to
8206b34
Compare
16bfcb4
to
9971c36
Compare
Co-authored-by: Marko Dimjašević <[email protected]>
It is currently not so easy to distinguish this particular error from a generic TLS error (see #1662 for more context). Since `InvalidCertificate` is never thrown, this PR simply removes it. Note that this is a breaking change in the federation protobuf.
Also suggest client behaviour in some cases.
4a5a259
to
13ae508
Compare
This adds documentation of federation errors to Swagger. These are not response entries by endpoints, but simply a list of errors (with some brief explanations) divided into categories. They apply more or less to all endpoints that have anything to do with federation.
I also pasted it here so it is possible to see it rendered without building anything: https://gist.github.com/pcapriotti/e50f61c3a8f6abab900e25c9ff3457aa.
TODO
Rethink some of the error codesAfter some discussion, we decided the error codes are mostly fine
Checklist
make git-add-cassandra-schema
to update the cassandra schema documentation.