fix: Handle missing share providers when promoting reshares #52013
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
The provider for mail shares is not available when the
sharebymailapp is disabled), and in that case aProviderExceptionis thrown when trying to get it.Note that this fix only catches the exception and that is it. If the
sharebymailapp is disabled and the deleted share had a mail reshare that reshare will not be promoted, and therefore it will still be a reshare if thesharebymailapp is enabled again (the reshare will not be deleted either because deleting a share only deletes the children returned by its provider, and the default provider used for user and group shares does not return mail shares).No tests were added to reduce the possible conflicts in the backports and ease including them in the RCs 🙈
How to test
sharebymailappResult with this pull request
The share is deleted
Result without this pull request
Error deleting the shareis shown. However, if the page is reloaded it can be seen that the share was actually deleted (as the error happened when promoting the reshares, and at that point the share was already deleted).