Skip to content

fix(files_sharing): Do not wrap password policy exception into a generic one - #49366

Merged
come-nc merged 3 commits into
masterfrom
fix/remove-share-hint-exception-wrapping
Dec 12, 2024
Merged

fix(files_sharing): Do not wrap password policy exception into a generic one#49366
come-nc merged 3 commits into
masterfrom
fix/remove-share-hint-exception-wrapping

Conversation

@come-nc

@come-nccome-nc commented Nov 19, 2024

Copy link
Copy Markdown
Contributor

Follow-up of #49361

Summary

Let the controller access the HintException and show the error to the user.

Checklist

@come-nccome-nc added the 3. to review Waiting for reviews label Nov 19, 2024
@come-nccome-nc self-assigned this Nov 19, 2024
@come-nccome-nc added this to the Nextcloud 31 milestone Nov 19, 2024
Comment threadlib/private/Share20/Manager.php Outdated
} catch (HintException $e) {
throw new \Exception($e->getHint());
}
$this->dispatcher->dispatchTyped(new ValidatePasswordPolicyEvent($password));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Still disappointed that this is done using exceptions rather than setting property on the even like isValid...

@tobiasKaminskytobiasKaminsky left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Unfortunately this does not fix it

@come-nc

Copy link
Copy Markdown
ContributorAuthor

Unfortunately this does not fix it

I’m out of ideas

@tobiasKaminsky

Copy link
Copy Markdown
Member

Do you need more info how to reproduce it?
Me as Android dev cannot really help, expect of steps to reproduce…

@come-nc

Copy link
Copy Markdown
ContributorAuthor

Do you need more info how to reproduce it? Me as Android dev cannot really help, expect of steps to reproduce…

Do you have a full stacktrace for the Exception? (with this PR applied on server side)

@come-nc
come-ncforce-pushed the fix/remove-share-hint-exception-wrapping branch from d0beeed to 900007dCompareDecember 10, 2024 10:06
@come-nc

Copy link
Copy Markdown
ContributorAuthor

@tobiasKaminsky Can you test again? It should be good now, message should be back and error code should be 400.

@tobiasKaminsky

Copy link
Copy Markdown
Member

This works now without any modification on client side 🎉

@tobiasKaminsky
tobiasKaminsky self-requested a review December 11, 2024 06:07
@tobiasKaminsky

Copy link
Copy Markdown
Member

@come-nc can we merge this? 💙

@come-nccome-nc added 4. to release Ready to be released and/or waiting for tests to finish and removed 3. to review Waiting for reviews labels Dec 12, 2024
…ric one
Let the controller access the HintException and show the error to the user.
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
This fixes a regression that bad password returned 403 instead of 400
because of previous changes.
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
@come-nc
come-ncforce-pushed the fix/remove-share-hint-exception-wrapping branch from cca3072 to 365ff40CompareDecember 12, 2024 14:39
@come-nc
come-nc merged commit 7cc8a1b into masterDec 12, 2024
@come-nc
come-nc deleted the fix/remove-share-hint-exception-wrapping branch December 12, 2024 16:51
@skjnldsvskjnldsv mentioned this pull request Jan 7, 2025
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

4. to releaseReady to be released and/or waiting for tests to finish

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@come-nc@tobiasKaminsky@susnux@provokateurin