massCode icon indicating copy to clipboard operation
massCode copied to clipboard

[Bug]: "A JavaScript error occurred in the main process" when Google Drive updated location

Open rogerioth opened this issue 2 years ago • 4 comments

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). image

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

  1. Store db.json on a folder in Google Drive
  2. 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.
  3. Google updated the drive location to (/Users//My Drive/Apps/massCode)
  4. Previous location were unavailable, and the error above was displayed.
  5. Removing the App and reinstalling it did not solve the issue
  6. I had to manually 'rm -rf' the local persistence directory at (./Library/Application Support/massCode) in order to fix this.
  7. 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

rogerioth avatar Oct 06 '22 02:10 rogerioth

had the same issue

no-mans avatar Oct 25 '22 09:10 no-mans

Same issue here.

dividedby-0 avatar Aug 07 '23 10:08 dividedby-0

Same on Windows using virtual drive. Unable to change it even uninstalling.

efrancou avatar Apr 08 '24 11:04 efrancou

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",
...
}

Amitind avatar Aug 16 '24 04:08 Amitind