-
-
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: Avoid failing to update the current version entry if there is none #38800
Conversation
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Signed-off-by: Louis Chemineau <louis@chmn.me>
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.
If this only happen when file size is 0, I think adding a special logic is better than catching exceptions as they can be caused be something else.
I pushed a commit to slightly change your fix. Let me know what you think.
Signed-off-by: Julius Härtl <jus@bitgrid.net>
/backport to stable27 |
/backport to stable26 |
@artonge Unfortunately your approach doesn't work as it would try to create the version twice when creating and calling putContent, once with the NodeCreatedEvent and once with the NodeWrittenEvent. Did you have any concrete concern regarding my approach of just catching potential not found rows when trying to get the existing version? |
Signed-off-by: Louis Chemineau <louis@chmn.me>
I updated the condition, tests seem happy now :) |
The backport to stable27 failed. Please do this backport manually. # Switch to the target branch and update it
git checkout stable27
git pull origin stable27
# Create the new backport branch
git checkout -b fix/foo-stable27
# Cherry pick the change from the commit sha1 of the change against the default branch
# This might cause conflicts. Resolve them.
git cherry-pick abc123
# Push the cherry pick commit to the remote repository and open a pull request
git push origin fix/foo-stable27 More info at https://docs.nextcloud.com/server/latest/developer_manual/getting_started/development_process.html#manual-backport |
The backport to stable26 failed. Please do this backport manually. # Switch to the target branch and update it
git checkout stable26
git pull origin stable26
# Create the new backport branch
git checkout -b fix/foo-stable26
# Cherry pick the change from the commit sha1 of the change against the default branch
# This might cause conflicts. Resolve them.
git cherry-pick abc123
# Push the cherry pick commit to the remote repository and open a pull request
git push origin fix/foo-stable26 More info at https://docs.nextcloud.com/server/latest/developer_manual/getting_started/development_process.html#manual-backport |
/backport to stable27 |
/backport to stable26 |
Hey @juliushaertl Still on issue. Just got this error on Nc 28.0.1 Dose this need to be merged to NC 28 ? please see error below
|
Same problem in 28.0.6. |
Signed-off-by: Julius Härtl jus@bitgrid.net
"SELECT * FROM *PREFIX*files_versions WHERE (file_id = :dcValue1) AND (timestamp = :dcValue2)";
#41174Summary
I managed to reproduce the error by having a file without a versions entry as it would be the case for files from before the upgrade to 25.
Steps to reproduce on latest master:
The first attempt to save will not create a version as the size is 0 and
server/apps/files_versions/lib/Storage.php
Lines 227 to 228 in c3475f4
It seemed reasonable to me to just create it in this case.
TODO
Checklist