-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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 status check and saving of external storages #46859
Fix status check and saving of external storages #46859
Conversation
/backport to stable29 |
76a8b73
to
2713e25
Compare
b953fca
to
7d8aa35
Compare
After a few rebases and job restarts CI is finally green 🎉 So I would recommend not to rebase again unless strictly needed ;-) |
7d8aa35
to
2dca2d8
Compare
I removed the automatic backport for stable28, as it was going to have conflicts. I will backport it manually as needed. Besides that, I added a little fix to keep the status width unmodified even if the internal span is removed (see scenario 2), and also added a fix to remove the tooltip from the default row used to select a backend and create a new mountpoint. As CI was going to run again anyway I also rebased everything on latest master. |
/backport to stable30 |
Adding @icewind1991 and @artonge as the files_external appowners :) |
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.
Looks good overall
When saving, updating and rechecking an storage fails (which is different to the soft-fail when the action itself succeeds but the status check does not) further details are provided in the error message of the response, which is now set as the tooltip. Signed-off-by: Daniel Calviño Sánchez <[email protected]>
If the status is updated but no explicit message is provided (for example, if the status check succeeded) the default tooltip (from the template) is now set to prevent a mismatch between the status and the tooltip (for example, if the configuration is fixed after a failed status check). Signed-off-by: Daniel Calviño Sánchez <[email protected]>
Signed-off-by: Daniel Calviño Sánchez <[email protected]>
As a new storage is added by selecting a backend the selected backend needs to be reset. Otherwise it is not possible to add another storage with the same backend. Signed-off-by: Daniel Calviño Sánchez <[email protected]>
As the external storage uses the Nextcloud server itself the number of workers of the PHP process running the Nextcloud server had to be increased. Otherwise if a request is sent for the external storage while handling a request from the integration tests a deadlock would occur. Signed-off-by: Daniel Calviño Sánchez <[email protected]>
When updating global storages and user storages a property is not updated by "StoragesService::updateStorage()" if the value matches the unmodified placeholder. However, userglobal storages are not updated through the "StoragesService"; as only the authentication mechanism is updated it is directly done with "saveBackendOptions()" in "IUserProvided" or "UserGlobalAuth". Due to this the unmodified placeholder value needs to be explicitly checked in those cases and replaced by the actual value (note that in this case it is not possible to just skip updating a specific property). Signed-off-by: Daniel Calviño Sánchez <[email protected]>
The row to add a new mount point is cloned when a new mountpoint is added, so it is expected that it includes a status span. However, it should not be displayed in that row, only in the cloned row when its status is updated. Signed-off-by: Daniel Calviño Sánchez <[email protected]>
2dca2d8
to
fa0862c
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
/backport to stable30 |
This comment was marked as outdated.
This comment was marked as outdated.
/backport to stable30 |
This comment was marked as outdated.
This comment was marked as outdated.
/backport to stable30 |
This comment was marked as outdated.
This comment was marked as outdated.
/backport to stable30 |
/backport to stable29 |
/backport to stable28 |
This pull request fixes several issues with the status check in the external storage administration UI:
It also fixes some issues when saving an storage in the external storage administration UI:
__unmodified__
as the password if it was not changed, which messes the saved configurationPlease refer to the individual commit descriptions for further details.
How to test (scenario 1)
apt install openssh-server
)useradd --create-home sftptest
)systemctl start sshd
; otherwise, for example, in Docker,mkdir /run/sshd && /usr/sbin/sshd -D
)Manually entered, store in database
127.0.0.1
Result with this pull request
The status check is automatically shown for the storage. Moreover, if the storage is saved again without changes the status will succeed again
Result without this pull request
The status check is not automatically shown for the storage. Moreover, if the user saves the configuration again to trigger the status check (rather than just clicking on the status check) the status will fail (because the password is unmodified and obfuscated, and that obfuscated password is the one saved)
How to test (scenario 2)
Result with this pull request
It is not possible to click on the status check (until the configuration is saved and the status check is shown again)
Result without this pull request
A click on the status check triggers a new check, which ends succeeding due to using the old configuration
How to test (scenario 3)
127.0.0.1
Result with this pull request
Tooltip was updated with the error message (Exception: Login failed)
Result without this pull request
Tooltip is still the original message (Click to recheck the configuration)
How to test (scenario 4)
127.0.0.1
Result with this pull request
Tooltip was restored with the default message (Click to recheck the configuration)
Result without this pull request
Tooltip is still the error message set when rechecking it (Exception: Login failed)
How to test (scenario 5)
Result with this pull request
Tooltip was updated with the error message (Storage with ID "X" not found)
Result without this pull request
Tooltip is still the original message (Click to recheck the configuration)
How to test (scenario 6)
Result with this pull request
Add storage is selected in the dropdown, and selecting again the same backend type as before adds a new entry
Result without this pull request
The same backend type is still selected in the dropdown, and selecting it again does nothing