massCode
massCode copied to clipboard
[Bug]: "A JavaScript error occurred in the main process" when Google Drive updated location
Describe the bug
While using the official macOS Google Drive app (as the storage of the snippet db), Google changed / moved the location of their directories, however, opening massCode doesn't allow for a change of location and user is kept in a error loop upon startup (not recoverable - clicking "Ok" does nothing, user is required to 'force quit' app).
Exception: Uncaught Exception: Error: EACCES: permission denied, mkdir '/Volumes/GoogleDrive/My Drive/Apps/massCode' at Object.mkdirSync (node:fs:1334:3) at Object.module.exports.makeDirSync (/Applications/massCode.app/Contents/Resources/app.asar/node_modules/fs-extra/lib/mkdirs/make-dir.js:23:13) at Object.createFileSync (/Applications/massCode.app/Contents/Resources/app.asar/node_modules/fs-extra/lib/ensure/file.js:59:45) at createDb (/Applications/massCode.app/Contents/Resources/app.asar/src/main/services/db/
To reproduce
- Store db.json on a folder in Google Drive
- Open it's location with masscode (eg: <GoogleDriveRoot>/Apps/massCode/db.json) (location was actually: /Volumes/GoogleDrive/My Drive/Apps/massCode). Alternatively, can use a temporary USB drive location.
- Google updated the drive location to (/Users/
/My Drive/Apps/massCode) - Previous location were unavailable, and the error above was displayed.
- Removing the App and reinstalling it did not solve the issue
- I had to manually 'rm -rf' the local persistence directory at (./Library/Application Support/massCode) in order to fix this.
- An improved error dialog should be displayed, perhaps with the option to "open storage" elsewhere
Version
v3.4.1
OS
macOS Monterey 12.6
Validations
- [X] Follow our Code of Conduct
- [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- [X] Check that this is a concrete bug. For Q&A open a GitHub Discussion.
had the same issue
Same issue here.
Same on Windows using virtual drive. Unable to change it even uninstalling.
On Windows update the new location in the file
C:\Users\**USERNAME**\AppData\Roaming\massCode\v2\preferences.json
new location of massCode
{
"storagePath": "I:\\massCode",
...
}