-
-
Notifications
You must be signed in to change notification settings - Fork 99
fix: prevent error when try to create a folder two times #5415
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: prevent error when try to create a folder two times #5415
Conversation
The LibreSign folder is created by every event that need to fetch files from this folder. When we try to create a folder or a file, before to finish the creation proccess, the folder is locked by Nextcloud. To prevent this, I made first a get, if is not found, I try to create. Signed-off-by: Vitor Mattos <[email protected]>
12a3322 to
d6f6f5d
Compare
|
/backport to stable31 |
|
/backport to stable30 |
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.
Is there a way to test this with PHPUnit? If so, it would be good.
|
Could be a bit complex because is out of scope of LibreSign but we can try. |
|
Understood. If possible, it would be good to have at least a test that proves that the bug beeing fixed here doen't happen anymore. |
|
I only reproduced the bug because the browser send two asynchronous requests to server and when we got two requests at the same time creating the same folder was possible to see the problem. It's sounds more that will be necessary an integration test than unit because I think that also will be necessary to authenticate an user. I think that at this case the best way is believe that it's OK, I don't know how to reproduce this easy into an unit test. |
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.
Understood, in this case, I too don't think it is worth implementing a integration test.
|
/backport to stable32 |
|
/backport to stable31 |
|
/backport to stable30 |

Pull Request Description
The LibreSign folder is created by every event that need to fetch files from this folder. When we try to create a folder or a file, before to finish the creation proccess, the folder is locked by Nextcloud. To prevent this, I made first a get, if is not found, I try to create.
Pull Request Type
Pull request checklist
How to see this running using GitHub Codespaces
1. Open the Codespace
Codebutton and select theCodespacestab.2. Wait for the environment to start
✍️ LibreSign is up!3. Access LibreSign in the browser
4. (Optional) Make the service public
⋮on the row for port 80.Change visibility→Public.5. Login credentials
adminadminDone! 🎉
You're now ready to test this.