-
-
Notifications
You must be signed in to change notification settings - Fork 10
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
Issue with store creating multiple .temp files and having issues writing to it #7
Comments
no one? |
Do you have a repro I can try?
Other than that Windows is a dumpster fire, if for whatever reason it just doesn't allow you to rename a file there's nothing the library can do to force it. I guess this library could try to write non-atomically in those situations, but that's nonsense for a library that explicitly provides atomic writes. |
Hi @fabiospampinato, |
It's something for electron-store to do |
Thanks, I will see if the author of electron-store does something. |
Hi,
I was asked to open a issue here by sindresorhus as he mentioned that you could help here (original request - sindresorhus/electron-store#261)
Issue:
I have a stored named MasterStore and it creates a MasterStore.json files and everything works prefect. However, after sometime for some reason the .setCache function errors out because it is trying to access some MasterStore.json.temp file. below is the error log
Error: EPERM: operation not permitted, rename 'C:\Users\AppData\Roaming\neclient\MasterStore.json.tmp-900921090850e765' -> 'C:\Users\AppData\Roaming\neclient\MasterStore.json' at renameSync (node:fs:993:3) at attempt (C:\Users\AppData\Local\Programs\neclient\resources\app\node_modules\atomically\dist\utils\retryify.js:33:27) at attempt (C:\Users\AppData\Local\Programs\neclient\resources\app\node_modules\atomically\dist\utils\retryify.js:39:36) at attempt (C:\Users\AppData\Local\Programs\neclient\resources\app\node_modules\atomically\dist\utils\retryify.js:39:36) at Object.writeFileSync (C:\Users\AppData\Local\Programs\neclient\resources\app\node_modules\atomically\dist\index.js:160:50) at ElectronStore._write (C:\Users\AppData\Local\Programs\neclient\resources\app\node_modules\conf\dist\source\index.js:375:28) at set store [as store] (C:\Users\AppData\Local\Programs\neclient\resources\app\node_modules\conf\dist\source\index.js:296:14) at ElectronStore.set (C:\Users\AppData\Local\Programs\neclient\resources\app\node_modules\conf\dist\source\index.js:189:20) at Object.setCacheValue (C:\Users\AppData\Local\Programs\neclient\resources\app\system_services\cache-service.js:59:21) at BeforeAppShutDown (C:\Users\AppData\Local\Programs\neclient\resources\app\main.js:352:23)
i crate the store using
const masterStore = new Store({ name: 'MasterStore' });
and set contents by masterStore.set(key, value);
can someone tell me what's the reason its doing this? and how i can fix it?
The text was updated successfully, but these errors were encountered: