-
Notifications
You must be signed in to change notification settings - Fork 2.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
[7.0.4] Renaming a folder shared from multiple groups in v<=7.0.2 create multiple shares to the user in v>= 7.0.4 #13429
Comments
@schiesbn @PVince81 FYI |
Ouch, I'm at step 4 and it already looks bad:
As you can see the user's child entry has no parent. It should link itself to either 1 or 2. |
Ah no, sorry. I misread (lines were wrapped on my screen). |
After the upgrade and rename, I see this:
Since I renamed "test1" and not "test1 (2)", a new entry is created which points to the share 1 instead of 2. I'd say this is expected. For every share through a different group, the recipient receives a separate folder. Ideally these shares should be combined and I'm not sure why they aren't, maybe because the combining code didn't exist back then in 7.0.2. Let's try the same steps from scratch directly on 7.0.4. |
On 7.0.4, at step 4 (after sharing with the two groups, group1 read-write and group2 read-only), I see this now:
Almost the same as before, but now the child entry is linked to share 1 instead of 2, and there is no "test1 (2)". Logging into the web UI as "u2" only shows a single folder "test1", which means that the shares have properly been merged. I can upload files, which means that the broadest permissions have been given (read-write instead of read-only). So far so good. After renaming "test1" to "test2", this is the DB:
So now it created a child entry for both group shares, having both renamed. I'll say that on 7.0.4 everything works as expected. The problem is mostly about recovering from the old 7.0.2 DB entries and converting them somehow to the 7.0.4 structure. @schiesbn what do you think ? |
So the migration step is to check for a share that is shared to two groups/users, where one user is in both groups. Then I have to delete the share, that points in the parent item to one of these previously found shares? Share to group abc and just test(who is in share) and a share to group abc and def (where user test is in both) are two valid cases that needs to be covered. And of course tit needs to be the same file_source? Or needs to be them item:source the same? What about reshares? @schiesbn @PVince81 Can you confirm this? @PVince81 To clarify your questions: I created the shares on stable6 (to match real world experience) and now the task would be to clean up the shares properly. First of all those |
I don't fully understand everything that is happening here yet. One question would be: would the repair step repair the previous situation (the one that we have before upgrade) or the one after the upgrade where it's already kind of broken ? |
Now thinking of it, deleting such bogus child entries could cause additional issues if these child entries are also parent of reshares (if the receipient user reshared that specific folder, like "test (2)") To answer your question, I believe that they all have to be the same file_source/item_source because all these share entry actually originate from the same file/folder. However "file_target" is the name of the file/folder as seen in the recipient's view. That one can be changed more freely. Having all "file_target" values the same for the recipient should automatically have the folder displayed as a single entry. |
@PVince81 I would like to fix the behaviour after the upgrade from 6 to pre-7.0.5 (because this cause the issue, if the linked PR is merged into 7.0.5). Then we need a tool to help the admin to fix this problem. I would first go for a tool that shows the different affected shares, then try to fix most of then and then list the admin the remaining shares, to directly contact the user to fix this somehow manually. Maybe this are three stages of one command, but as this affects huge installations it is hopefully worth the effort. @DeepDiver1975 @schiesbn @PVince81 Opinions? |
Providing a tool to repair shares seems to be a lot of work. So far the "policy" was always to try and repair as much as possible automatically. Do we want to start introducing GUI or CLI specialized tools for manually fixing shares (and also broken legacy storages ?) Or is a documentation with SQL queries enough ? |
The repair step before the upgrade sounds like a good idea. |
@PVince81 I would like to just wrap some SQL statements into these commands. |
I'm agree, preventing is good 👍 but most users will see that the problem exist after upgrade. Or will be the solution in the upgrade script? |
I justed talked to @schiesbn and he said that there was a valid reason to not group this after the upgrade. For the user it could produce weird behaviour if the user renamed both shares and moved it to different location. Then some random folders could be removed, because previously it was a share and it will be grouped together with another one. @cdamken Is this a possible solution? Its from a technical point it's really hard to detect the shares that can be grouped. It's nowadays just a new feature, that shares a grouped. Doing it afterwards is just really hard. |
@cdamken See my last comment with a possible solution for this |
@MorrisJobke It sounds reasonable. Thank you |
Reason for close: see #13429 (comment) |
Steps to reproduce:
Expected behaviour:
Either:
Actual behaviour:
Note: This is a follow-up from #12475 .
The text was updated successfully, but these errors were encountered: