Skip to content

Conversation

@vitormattos
Copy link
Member

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

  • Bugfix

Pull request checklist

  • Did you explain or provide a way of how can we test your code ?
  • If your pull request is related to frontend modifications provide a print of before and after screen
  • Did you provide a general summary of your changes ?
  • Try to limit your pull request to one type, submit multiple pull requests if needed
  • I implemented tests that cover my contribution
How to see this running using GitHub Codespaces

1. Open the Codespace

  • Authenticate to GitHub
  • Go to the branch: chore/reduce-configure-check-time
  • Click the Code button and select the Codespaces tab.
  • Click "Create codespace on feat/customize-signature-stamp"

2. Wait for the environment to start

  • A progress bar will appear on the left.
  • After that, the terminal will show the build process.
  • Wait until you see the message:
    ✍️ LibreSign is up!
    This may take a few minutes.

3. Access LibreSign in the browser

  • Open the Ports tab (next to the Terminal).
  • Look for the service running on port 80.
  • Hover over the URL and click the globe icon 🌐 to open it in your browser.

4. (Optional) Make the service public

  • If you want to share the app with people not logged in to GitHub, you must change the port visibility:
    • Click the three dots on the row for port 80.
    • Select Change visibilityPublic.

5. Login credentials

  • Username: admin
  • Password: admin

Done! 🎉
You're now ready to test this.

@vitormattos vitormattos added this to the Next Major (32) milestone Sep 4, 2025
@vitormattos vitormattos self-assigned this Sep 4, 2025
@github-project-automation github-project-automation bot moved this to 0. Needs triage in Roadmap Sep 4, 2025
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]>
@vitormattos vitormattos force-pushed the fix/prevent-error-when-try-to-create-a-folder-two-times branch from 12a3322 to d6f6f5d Compare September 5, 2025 12:29
@vitormattos
Copy link
Member Author

/backport to stable31

@vitormattos
Copy link
Member Author

/backport to stable30

Copy link
Member

@AntDavidLima AntDavidLima left a 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.

@vitormattos
Copy link
Member Author

Could be a bit complex because is out of scope of LibreSign but we can try.

@AntDavidLima
Copy link
Member

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.

@vitormattos
Copy link
Member Author

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.

Copy link
Member

@AntDavidLima AntDavidLima left a 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.

@github-project-automation github-project-automation bot moved this from 0. Needs triage to 1. to do in Roadmap Sep 8, 2025
@vitormattos
Copy link
Member Author

/backport to stable32

@vitormattos
Copy link
Member Author

/backport to stable31

@vitormattos
Copy link
Member Author

/backport to stable30

@vitormattos vitormattos merged commit bd065e4 into main Sep 8, 2025
59 checks passed
@vitormattos vitormattos deleted the fix/prevent-error-when-try-to-create-a-folder-two-times branch September 8, 2025 17:23
@github-project-automation github-project-automation bot moved this from 1. to do to 4. to release in Roadmap Sep 8, 2025
@vitormattos
Copy link
Member Author

Only by documentation purpose, follow a screenshot that reproduce the issue:

Screenshot_20250909_121355

This occur at the first time that we open a document form app Files, choose to see the document at LibreSign and click to sign the document.

After this fix, this flow worked fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants