Skip to content
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

Support moving versions across storages #2860

Merged

Conversation

artonge
Copy link
Contributor

@artonge artonge commented Mar 14, 2024

As of nextcloud/server#44187

One limitation is that when copying a folder from and to a groupfolder, versions of subfolders will be lost. This is due to the NodeCopiedEvent event not containing the list of moved files in subfolders. This needs to be addressed in the server.

Example: When moving /a containing /a/b/c.txt into /d which is a groupfolder, then c.txt will lose its versions because the NodeCopiedEvent does not contain the information that c.txt was copied. Weirdly, it works when moving a folder containing /a/c.txt.

The test exists and is disabled for now.

@artonge artonge self-assigned this Mar 14, 2024
@artonge artonge added enhancement 2. developing Items that are currently under development php Items related to PHP updates and code issues version feature: versions Items related to file versioning and removed version labels Mar 14, 2024
@artonge artonge force-pushed the artonge/chore/use_new_version_metadata_api branch 3 times, most recently from b009ced to 7ae2223 Compare March 18, 2024 15:41
@artonge artonge force-pushed the artonge/feat/support_moving_versions_across_storages branch from 5bb731e to 411607e Compare March 18, 2024 15:55
Base automatically changed from artonge/chore/use_new_version_metadata_api to master March 20, 2024 12:45
@artonge artonge marked this pull request as ready for review March 20, 2024 15:38
@artonge artonge force-pushed the artonge/feat/support_moving_versions_across_storages branch 2 times, most recently from 59fb534 to a09fa85 Compare March 21, 2024 11:30
@artonge artonge force-pushed the artonge/feat/support_moving_versions_across_storages branch 7 times, most recently from c2a8c68 to 006022a Compare March 27, 2024 16:33
@artonge artonge force-pushed the artonge/feat/support_moving_versions_across_storages branch 7 times, most recently from a0e5d8f to fed1b23 Compare April 4, 2024 13:52
@artonge artonge force-pushed the artonge/feat/support_moving_versions_across_storages branch from fed1b23 to 90d7c85 Compare April 4, 2024 13:54
Copy link
Contributor

@come-nc come-nc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was moving from one groupfolders to another also tested?
And moving from groupfolder to folder?

@artonge
Copy link
Contributor Author

artonge commented Apr 4, 2024

Was moving from one groupfolders to another also tested?

Out of the scope of this PR. This is only tackling folder to groupfolder move, and vis versa.

And moving from groupfolder to folder?

Yes, both way.

@artonge artonge force-pushed the artonge/feat/support_moving_versions_across_storages branch from 90d7c85 to 29a63be Compare April 4, 2024 15:20
@artonge artonge force-pushed the artonge/feat/support_moving_versions_across_storages branch from 29a63be to 8e74fd6 Compare April 4, 2024 15:30
@artonge artonge merged commit 3e6f170 into master Apr 4, 2024
48 checks passed
@artonge artonge deleted the artonge/feat/support_moving_versions_across_storages branch April 4, 2024 21:58
@artonge
Copy link
Contributor Author

artonge commented Apr 5, 2024

/backport to stable29

@come-nc
Copy link
Contributor

come-nc commented Apr 11, 2024

$ occ groupfolders:expire
Expiring version in 'Test'
An unhandled exception has been thrown:
TypeError: OCA\GroupFolders\Versions\VersionsBackend::getVersionFolderForFile(): Argument #1 ($file) must be of type OCP\Files\File, OC\Files\FileInfo given, called in /var/www/html/apps-extra/groupfolders/lib/Versions/VersionsBackend.php on line 92 and defined in /var/www/html/apps-extra/groupfolders/lib/Versions/VersionsBackend.php:78
Stack trace:
#0 /var/www/html/apps-extra/groupfolders/lib/Versions/VersionsBackend.php(92): OCA\GroupFolders\Versions\VersionsBackend->getVersionFolderForFile(Object(OC\Files\FileInfo))
#1 /var/www/html/apps-extra/groupfolders/lib/Versions/GroupVersionsExpireManager.php(81): OCA\GroupFolders\Versions\VersionsBackend->getVersionsForFile(Object(OC\User\User), Object(OC\Files\FileInfo))
#2 /var/www/html/apps-extra/groupfolders/lib/Versions/GroupVersionsExpireManager.php(60): OCA\GroupFolders\Versions\GroupVersionsExpireManager->expireFolder(Array)
#3 /var/www/html/apps-extra/groupfolders/lib/Command/ExpireGroup/ExpireGroupVersions.php(66): OCA\GroupFolders\Versions\GroupVersionsExpireManager->expireAll()
#4 /var/www/html/apps-extra/groupfolders/lib/Command/ExpireGroup/ExpireGroupVersionsTrash.php(54): OCA\GroupFolders\Command\ExpireGroup\ExpireGroupVersions->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#5 /var/www/html/3rdparty/symfony/console/Command/Command.php(298): OCA\GroupFolders\Command\ExpireGroup\ExpireGroupVersionsTrash->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#6 /var/www/html/core/Command/Base.php(177): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#7 /var/www/html/3rdparty/symfony/console/Application.php(1040): OC\Core\Command\Base->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#8 /var/www/html/3rdparty/symfony/console/Application.php(301): Symfony\Component\Console\Application->doRunCommand(Object(OCA\GroupFolders\Command\ExpireGroup\ExpireGroupVersionsTrash), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#9 /var/www/html/3rdparty/symfony/console/Application.php(171): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#10 /var/www/html/lib/private/Console/Application.php(213): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#11 /var/www/html/console.php(113): OC\Console\Application->run()
#12 /var/www/html/occ(11): require_once('/var/www/html/c...')
#13 {main}⏎                                                      

@artonge There is a typing problem it seems?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2. developing Items that are currently under development enhancement feature: versions Items related to file versioning php Items related to PHP updates and code issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants