No description
Find a file
ml2310 f799e6cc26 Fix: pendingOps flooding on every Obsidian restart (v0.1.2)
Root causes found and fixed:
1. mergeOfflineDiff() was called before onLayoutReady — vault.getFiles()
   returns stale/zero stats before layout ready, causing all 6000+ files
   to be flagged as modified on every startup. Moved to onLayoutReady.
2. onunload() called saveSettings() before snapshot.save(), so the fresh
   snapshot was never persisted to data.json. Fixed order.
3. Snapshot contained 261 .obsidian entries (from earlier versions).
   vault.getFiles() never returns .obsidian files, so all 261 were
   flagged as 'delete' on every restart. Fixed: added .obsidian to
   exclude(), purge in setRaw(), cleaned existing data.json.
4. Snapshot now stored in data.json (loadData/saveData) for reliability.
   Removed dependency on .neogdsync/snapshot.json file write.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 00:05:44 +08:00
src Fix: pendingOps flooding on every Obsidian restart (v0.1.2) 2026-04-14 00:05:44 +08:00
.gitignore Initial release of NeoGDSync v0.1.0 2026-04-13 01:44:39 +08:00
esbuild.config.mjs Initial release of NeoGDSync v0.1.0 2026-04-13 01:44:39 +08:00
LICENSE Add MIT license 2026-04-13 02:04:58 +08:00
main.js Fix: pendingOps flooding on every Obsidian restart (v0.1.2) 2026-04-14 00:05:44 +08:00
manifest.json Fix: pendingOps flooding on every Obsidian restart (v0.1.2) 2026-04-14 00:05:44 +08:00
README.md Add README 2026-04-13 02:00:24 +08:00
styles.css Initial release of NeoGDSync v0.1.0 2026-04-13 01:44:39 +08:00
tsconfig.json Initial release of NeoGDSync v0.1.0 2026-04-13 01:44:39 +08:00

NeoGDSync

Lightweight Google Drive sync plugin for Obsidian.

Features

  • Smart Sync — auto conflict detection, only syncs changed files
  • Force Push — local vault → Google Drive
  • Force Pull — Google Drive → local vault
  • Conflict handling — saves Drive copy as a conflict file, never overwrites silently
  • Path-based index — fast, no full crawl needed after first sync
  • Version history — optionally keep file revisions on Drive
  • Configurable excludes — glob patterns to skip files/folders
  • URI handlerobsidian://neogdsync?mode=smart|push|pull for automation

Setup

  1. Install the plugin
  2. Go to Settings → NeoGDSync
  3. Enter your Google OAuth2 Refresh Token
  4. Enter your Google Drive Vault Root Folder ID (the Drive folder that maps to your vault root)
  5. Click the ☁ ribbon icon or run a command to sync

Getting a Refresh Token

This plugin uses a standard OAuth2 refresh token with read/write access to Google Drive.

You can obtain one via:

The token is stored locally in your vault's plugin data and never leaves your device except to authenticate with Google.

Commands

Command Description
Smart Sync Detect and sync only changed files, with conflict detection
Force Push Upload all local changes to Drive
Force Pull Download all Drive changes to local
Rebuild Drive Index Re-crawl Drive vault folder to rebuild index
Show Conflicts View detected conflicts

URI Handler

Trigger sync from outside Obsidian (Shortcuts, scripts, etc.):

obsidian://neogdsync?mode=smart
obsidian://neogdsync?mode=push
obsidian://neogdsync?mode=pull

License

MIT