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

'no such file' error on first save at LOCAL_FILE_PATH #38

Closed
Jan-Ka opened this issue Oct 1, 2017 · 2 comments · Fixed by #41
Closed

'no such file' error on first save at LOCAL_FILE_PATH #38

Jan-Ka opened this issue Oct 1, 2017 · 2 comments · Fixed by #41
Labels

Comments

@Jan-Ka
Copy link
Contributor

Jan-Ka commented Oct 1, 2017

When running the application for the first time the user will experience an error like

Error: ENOENT: no such file or directory, open '/home/username/.local/share/cube/times.csv'
    at [stacktrace]

It appears to be a timing issue when creating the folder with mkdirp. The default function is asynchronous, there is a dedicated synchronized version.

mkdirp does not return it's internal promise, because of this it would be probably better to either switch to mkdirp.sync or to create a own version.

@Jan-Ka
Copy link
Contributor Author

Jan-Ka commented Oct 1, 2017

Not sure if mkdirp is the real culprit here, while my observation with it is true I found out that the newest version of file-exists also switched to the same pattern of having an async default function and an sync fallback.

50% sure this is only an issue because I decided to upgrade packages prematurely instead of waiting for #33.

@icyflame
Copy link
Owner

icyflame commented Oct 3, 2017

Your observations are true, we should use the sync version. A stat and a mkdirp should take miniscule time on all modern computers.

This is a change in the API, I think. I should have freezed the versions in the package.json. 🙁

Anyway, this is the plan I have for now:

  1. Remove the file-exists dependency. Instead use fs.existsSync
  2. Review and merge 'no such file' error on first save at LOCAL_FILE_PATH #41
  3. Freeze versions and publish a release with these freezed versions

@icyflame icyflame added the bug label Oct 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants