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

fix(federation): Allow cloud federation providers to handle unsuccess… #43884

Merged
merged 1 commit into from
Feb 28, 2024

Conversation

nickvergessen
Copy link
Member

…ful return codes

Otherwise they are put to retry and will immediately trigger bruteforce protection infinitely. This is currently easily producable when a federated user leaves a room during a "netsplit", maintenance mode or with a temporary error and afterwards people posting in the normal chat room.

Checklist

@nickvergessen nickvergessen added bug 3. to review Waiting for reviews high feature: federation pending documentation This pull request needs an associated documentation update labels Feb 28, 2024
@nickvergessen nickvergessen added this to the Nextcloud 29 milestone Feb 28, 2024
@nickvergessen nickvergessen self-assigned this Feb 28, 2024
* @throws \Throwable When $e did not have a response
* @since 29.0.0
*/
public function getResponseFromThrowable(\Throwable $e): IResponse;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added and used this method. I also put it in OCP, because it's not the first time where I find myself wanting to get the response of a "Guzzle ClientException" as an IResponse, without new \OC\…\Response() violating private class access.

…ful return codes

Otherwise they are put to retry and will immediately trigger bruteforce protection infinitely

Signed-off-by: Joas Schilling <coding@schilljs.com>
@nickvergessen nickvergessen force-pushed the bugfix/noid/allow-to-handle-error-codes branch from 3e615d0 to ecb111c Compare February 28, 2024 09:21
* @throws OCMProviderException
* @since 29.0.0
*/
public function sendCloudShare(ICloudFederationShare $share): IResponse;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why add two new methods when you could modify the exisitng one?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because it would now throw instead of returning false, which would break the current consumers?

@ChristophWurst ChristophWurst added 4. to release Ready to be released and/or waiting for tests to finish and removed 3. to review Waiting for reviews labels Feb 28, 2024
@nickvergessen nickvergessen merged commit 7cc2046 into master Feb 28, 2024
160 checks passed
@nickvergessen nickvergessen deleted the bugfix/noid/allow-to-handle-error-codes branch February 28, 2024 11:48
@blizzz blizzz mentioned this pull request Mar 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4. to release Ready to be released and/or waiting for tests to finish bug feature: federation high pending documentation This pull request needs an associated documentation update
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants