Fix cancelling the customization of a share - #63227
Open
danxuliu wants to merge 10 commits into
Open
Conversation
The SharingDetailsTab provides buttons to cancel and save the share, so the share should be saved only when doing it explicitly. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
"onNoteChange" is not called from anywhere, so "newNote" is never set and therefore "onNoteSubmit" does nothing. "onMenuClose" is not called from anywhere either in "SharingEntry". Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
The SharingDetailsTab provides buttons to cancel and save the share, so the share should be saved only when doing it explicitly. Moreover, the documentation of "onPasswordSubmit" mentions that it was saved when closing the menu because the password is the only property that is not automatically synced, so this was clearly a legacy behaviour. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
The methods and properties were not used anywhere. There are very similar ones in SharingDetailsTab, so it seems that they were a leftover from when they were moved there. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
If video verification is enabled it is not possible to save a share without a password. This could happen if the password is removed without unchecking first the video verification. Therefore, if the password is disabled now the video verification is also disabled when the share is saved. An alternative would be to disable the video verification in the share object as soon as the password is disabled, even if it was not saved yet. However the video verification was not disabled until the share is saved to ensure that, for example, a misclick on the password does not change the video verification state and forces the user to explicitly enable it again. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
The SharingDetailsTab provides buttons to cancel and save the share, so the share should be saved only when doing it explicitly. Note that although "saveShare()" only sends the password when it is modified there is no need to explicitly send it for mail shares like it was done in the removed code, as for mail shares the "Video verification" checkbox is shown only when the password was modified, so "password" is implicitly sent when "sendPasswordByTalk" is sent. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
This has been broken since it was refactored in 208ff80, although it seems that the method was not used anywhere (not even when it was refactored). Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Member
Author
|
/backport to stable34 please |
Member
Author
|
/backport to stable33 please |
Member
Author
|
/backport to stable32 please |
danxuliu
force-pushed
the
fix-cancelling-the-customization-of-a-share
branch
2 times, most recently
from
August 13, 2026 17:27
f48db9e to
cc36550
Compare
The SharingDetailsTab receives a share object and uses it as the model to be edited from the UI components. Therefore, when the edition is cancelled, the share object should be returned to its original state. Otherwise any UI using the share object would still show the modified state. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
"newPassword" is internally delegated by the share object to "_share.newPassword" through getter and setter properties. Therefore deleting "newPassword" has no effect, as there is no such attribute, and it should be set to undefined instead. Now that "newPassword" is correctly cleared "Set password" is no longer checked if the share of a password is removed, the share is updated, and the share is customized again (without reloading the page in the meantime). Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
danxuliu
force-pushed
the
fix-cancelling-the-customization-of-a-share
branch
from
August 13, 2026 18:46
cc36550 to
a79d951
Compare
Member
Author
|
/compile |
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
danxuliu
marked this pull request as ready for review
August 13, 2026 20:31
danxuliu
requested review from
icewind1991,
kristian-zendato,
leftybournes,
provokateurin,
salmart-dev and
skjnldsv
and removed request for
a team
August 13, 2026 20:31
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
In the past shares were edited through a dropdown menu, and changed settings were immediately applied. Since #39472 a panel with the different settings and buttons to save and cancel the changes is used instead. However, some specific settings were still saved as soon as they were modified, even if the changes were later cancelled.
Besides that, the panel modifies the received share object whenever a setting is changed (even if they are not applied on the server), but the changes were not reverted when the edition was cancelled. Due to that, if the share was customized again after cancelling the previous changes were still there.
This pull request fixes all that by removing the immediate saving on those settings that still had it, and reverting the changes to the share object when the edition is cancelled.
Additionally it also fixes a problem when the password is removed and Video verification was checked (scenario 4 below) and a problem with how the new password was cleared (scenario 7 below). They were not really issues when cancelling the edition but when saving the share, but in the first case the code was quite related and in the second the effect was similar (inconsistent UI if the share was edited again), so they were included here.
How to test (scenario 1)
Result with this pull request
The share is not saved
Result without this pull request
The share is saved
How to test (scenario 2)
Result with this pull request
The share is not saved
Result without this pull request
The share is saved
How to test (scenario 3)
Result with this pull request
The share is not saved
Result without this pull request
The share is saved
How to test (scenario 4)
Result with this pull request
Saving the share succeeds
Result without this pull request
Saving the share fails
How to test (scenario 5)
Result with this pull request
Everything is back to the original state. If the page is reloaded and the share customized again everything is in the original state.
Result without this pull request
Everything is still set despite being cancelled. If the page is reloaded and the share customized again then the password, video verification and hide download are checked, but the rest is back to the original state.
How to test (scenario 6)
Result with this pull request
Everything is back to the original state. If the page is reloaded and the share customized again everything is in the original state.
Result without this pull request
Everything* is still set (or disallowed) despite being cancelled. If the page is reloaded and the share customized again everything is in the original state.
How to test (scenario 7)
Result with this pull request
The password is unchecked
Result without this pull request
The password is checked. If the page is reloaded and the share customized again the password is unchecked