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

Create the block folder at boot #911

Open
wants to merge 1 commit into
base: staging
Choose a base branch
from

Conversation

superboum
Copy link

The bug

Currently, Fs.writeFile(fullPath, 'PLACEHOLDER\n', w()); always fails silently.
It fails silently because the error is not checked on Fs.writeFile.
And it fails because the block folder is not created before we try to write the file.

Behaviour on the /checkup script

As a consequence, the first time you launch the server, the placeholder.txt file is not created.
When you run the checkup script, it fails to find the file but creates the missing folder as, as soon you ask to store a proper block, because the called logic has the Fse.mkdirp logic, and thus the folder is created. So, on the next restart of Cryptpad, the placeholder.txt file can be created, and magically, the checkup script succeed.

My patch

I create the block folder and check for error before trying to create placeholder.txt, then I also check for error during the placeholder.txt file creation.

@ghost ghost changed the base branch from main to staging August 30, 2023 08:32
@ghost ghost requested a review from yflory August 30, 2023 08:32
@ghost ghost assigned yflory Oct 10, 2023
@ghost ghost removed the request for review from yflory October 10, 2023 09:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants