Skip to content

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

Open
@rogerioth

Description

@rogerioth

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: /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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions