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

Vault Path can't contain dots (MacOS FileProvider issue) #47

Open
jonashaefele opened this issue Oct 16, 2024 · 0 comments
Open

Vault Path can't contain dots (MacOS FileProvider issue) #47

jonashaefele opened this issue Oct 16, 2024 · 0 comments

Comments

@jonashaefele
Copy link

I eventually decided to move away from Obsidian Sync because it keeps accidentally deleting files for me. I tried Dropbox (which struggles with emojis in the file names) and have now landed on Google Drive, which syncs just fine from Mac to Android (with the help of Autosyc).

Anyway, because of Apple's new FileProvider API, you can't choose where it stores the synced files any more.

So my obsidian vault is now at:

/Users/name/Library/CloudStorage/[email protected]/My Drive/Obsidian

If I add that to the SC environment path, it sets the config correctly in 'user-data/settings.json':

  "envs": {
    "Obsidian": {
      "name": "Obsidian",
      "env_path": "/Users/name/Library/CloudStorage/[email protected]/My Drive/Obsidian"
    }
  }

but then when reloading, it somehow tries to split the path string by dots . and errors out.

Using a folder alias that points /Users/name/Google Drive to /Users/name/Library/CloudStorage/[email protected]/ and trying to choose a folder accessed through that alias as the env_path leads to SC simply not saving that change. It just ignores it. (I assume the path it get's from the file picker is somehow funny?)

(I used the folder alias that Google Drive automatically created in ~ and simply renamed them to not include a .)

However, setting the path through the alias manually in config.json works just fine:

 "envs": {
    "Obsidian": {
      "name": "Obsidian",
      "env_path": "/Users/name/Google Drive/My Drive/Obsidian"
    }
  },

TL;DR:

  • dots . in the env path break SC initialisation
  • for me that was unavoidable because MacOS FileProvider API automatically manages the folder names for Google Drive or Dropbox and adds the email addresses of the accounts to the folder name
  • workaround is using an alias to the FileProvider folder which doesn't include a dot .
  • selecting an alias folder in SC leads to error (ignore)
  • manually setting an alias folder in setting.json works just fine
  • Maybe SC could
    • allow for dots in env path (could be as simple as changing the line below, maybe)
    • allow for alias folders

The stack trace points to
--> src/components/envs_settings.js
--> async function post_process10
-->

const env_settings_containers = frag.querySelectorAll("[data-smart-settings]");
    for (const env_settings_container of env_settings_containers) {
        const env_scope = env_settings_container.dataset.smartSettings.split(".").reduce((_scope,key)=>_scope[key], scope); // This line
        await env_scope.render_settings(env_settings_container);
    }

Screenshot attached. (my email ends in slow.works hence the works left there.)
Screenshot 2024-10-16 at 14 18 36

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant