Fix valid storages removed when cleaning remote storages#25331
Merged
MorrisJobke merged 2 commits intomasterfrom Mar 18, 2021
Merged
Fix valid storages removed when cleaning remote storages#25331MorrisJobke merged 2 commits intomasterfrom
MorrisJobke merged 2 commits intomasterfrom
Conversation
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Member
Author
|
/backport to stable20 |
Member
Author
|
/backport to stable19 |
rullzer
approved these changes
Jan 27, 2021
The remote URL of a share is always stored in the database with a trailing slash. However, when a cloud ID is generated trailing slashes are removed. The ID of a remote storage is generated from the cloud ID, but the "cleanup-remote-storage" command directly used the remote URL stored in the database. Due to this, even if the remote storage was valid, its ID did not match the ID of the remote share generated by the command and ended being removed. Now the command generates the ID of remote shares using the cloud ID instead, just like done by the remote storage, so there is no longer a mismatch. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
91ff735 to
9ccabff
Compare
Merged
Member
|
/backport to stable21 |
This was referenced Mar 18, 2021
Member
|
so after just merging this, psalm is unhappy about the merge: https://github.com/nextcloud/server/actions/runs/664180405 |
Member
Member
|
seems not, probably a hiccup from Github. |
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.

The remote URL of a share is always stored in the database with a trailing slash. However, when a cloud ID is generated trailing slashes are removed.
The ID of a remote storage is generated from the cloud ID, but the
cleanup-remote-storagecommand directly used the remote URL stored in the database. Due to this, even if the remote storage was valid, its ID did not match the ID of the remote share generated by the command and ended being removed.Now the command generates the ID of remote shares using the cloud ID instead, just like done by the remote storage, so there is no longer a mismatch.