Skip to content

feat: introduce Obsidian vault sync plugin#1286

Merged
MODSetter merged 57 commits intoMODSetter:devfrom
AnishSarkar22:feat/obsidian-plugin
Apr 27, 2026
Merged

feat: introduce Obsidian vault sync plugin#1286
MODSetter merged 57 commits intoMODSetter:devfrom
AnishSarkar22:feat/obsidian-plugin

Conversation

@AnishSarkar22
Copy link
Copy Markdown
Contributor

@AnishSarkar22 AnishSarkar22 commented Apr 21, 2026

Description

  • Added a new SurfSense Obsidian plugin (surfsense_obsidian/) with native vault sync support.
  • Reworked Obsidian integration from legacy server-path scanning to a plugin-driven HTTPS sync model.
  • Added plugin API routes for full lifecycle: connect, sync, rename, delete, manifest, stats, health.
  • Implemented vault identity + dedupe using vault_id and vault_fingerprint with DB-level uniqueness constraints.
  • Added migration to mark old Obsidian connectors as legacy/deactivated and enforce plugin connector uniqueness.
  • Added strict attachment handling for plugin uploads with extension + MIME validation.
  • Added support for plugin-synced files:
    • Markdown: .md
    • Attachments: .pdf, .png, .jpg, .jpeg, .gif, .webp, .svg, .txt
  • Added backend plugin indexer flow for:
    • content-hash-aware upserts
    • attachment ETL extraction
    • manifest-based reconciliation
  • Improved plugin UX with better status handling (status bar/modal, auth/offline/error feedback, reconnect behavior).
  • Updated web connector UI to a plugin-first Obsidian flow (instructional connect, read-only plugin stats, legacy migration messaging).
  • Updated Obsidian connector docs and setup/migration guidance in web docs.
  • Added CI/CD for plugin quality and release:
    • plugin lint/build workflow
    • tag-based Obsidian plugin release workflow
  • Added backend test coverage:
    • integration tests for route contracts + connect race/dedupe
    • unit tests for plugin indexer and binary attachment validation.
  • Improved UI for report and resume right panel.

Motivation and Context

FIX #

Screenshots

API Changes

  • This PR includes API changes

Change Type

  • Bug fix
  • New feature
  • Performance improvement
  • Refactoring
  • Documentation
  • Dependency/Build system
  • Breaking change
  • Other (specify):

Testing Performed

  • Tested locally
  • Manual/QA verification

Checklist

  • Follows project coding standards and conventions
  • Documentation updated as needed
  • Dependencies updated as needed
  • No lint/build errors or new warnings
  • All relevant tests are passing

High-level PR Summary

This PR introduces a native Obsidian vault sync plugin that replaces the legacy server-side file scanner. The plugin runs inside Obsidian on desktop and mobile, pushing vault changes over HTTPS to the SurfSense backend via new /api/v1/obsidian/* endpoints. It implements realtime sync with persistent queues, fingerprint-based cross-device deduplication, adaptive reconciliation backoff, and tombstone tracking for delete events. The backend adds partial unique indexes on vault_id and vault_fingerprint, deactivates pre-plugin connectors via an Alembic migration, and exposes manifest/stats endpoints for the plugin's diffing logic. The web UI is updated to guide users through plugin installation instead of prompting for vault paths, with separate views for legacy and plugin-driven connectors.

⏱️ Estimated Review Time: 3+ hours

💡 Review Order Suggestion
Order File Path
1 manifest.json
2 versions.json
3 surfsense_obsidian/manifest.json
4 surfsense_obsidian/versions.json
5 surfsense_obsidian/README.md
6 surfsense_obsidian/package.json
7 surfsense_obsidian/tsconfig.json
8 surfsense_obsidian/eslint.config.mts
9 surfsense_obsidian/esbuild.config.mjs
10 surfsense_backend/app/schemas/obsidian_plugin.py
11 surfsense_backend/app/routes/obsidian_plugin_routes.py
12 surfsense_backend/app/services/obsidian_plugin_indexer.py
13 surfsense_backend/alembic/versions/129_obsidian_plugin_vault_identity.py
14 surfsense_backend/app/db.py
15 surfsense_backend/app/app.py
16 surfsense_backend/app/routes/__init__.py
17 surfsense_obsidian/src/types.ts
18 surfsense_obsidian/src/api-client.ts
19 surfsense_obsidian/src/queue.ts
20 surfsense_obsidian/src/vault-identity.ts
21 surfsense_obsidian/src/excludes.ts
22 surfsense_obsidian/src/payload.ts
23 surfsense_obsidian/src/sync-engine.ts
24 surfsense_obsidian/src/main.ts
25 surfsense_obsidian/src/settings.ts
26 surfsense_obsidian/src/status-bar.ts
27 surfsense_obsidian/src/status-modal.ts
28 surfsense_obsidian/src/folder-suggest-modal.ts
29 surfsense_obsidian/styles.css
30 surfsense_backend/tests/integration/test_obsidian_plugin_routes.py
31 .github/workflows/obsidian-plugin-lint.yml
32 .github/workflows/release-obsidian-plugin.yml
33 surfsense_web/components/assistant-ui/connector-popup/connect-forms/components/obsidian-connect-form.tsx
34 surfsense_web/components/assistant-ui/connector-popup/connector-configs/components/obsidian-config.tsx
35 surfsense_web/components/assistant-ui/connector-popup/connector-benefits.ts
36 surfsense_web/components/assistant-ui/connector-popup/constants/connector-constants.ts
37 surfsense_web/components/assistant-ui/connector-popup/hooks/use-connector-dialog.ts
38 surfsense_web/components/assistant-ui/connector-popup/connector-configs/views/connector-edit-view.tsx
39 surfsense_web/lib/apis/connectors-api.service.ts
40 surfsense_web/.env.example
41 surfsense_web/app/api/zero/query/route.ts
42 surfsense_web/next.config.ts
43 docker/.env.example
44 docker/docker-compose.yml
45 surfsense_obsidian/LICENSE
46 surfsense_obsidian/AGENTS.md
47 surfsense_obsidian/.editorconfig
48 surfsense_obsidian/.gitignore
49 surfsense_obsidian/.npmrc
50 surfsense_obsidian/version-bump.mjs

Need help? Join our Discord

Analyze latest changes

…chemas, and UI components for cleaner integration
…ing inclusion/exclusion settings and a status modal for real-time updates
…lugin for improved reconciliation and performance
…ing vault fingerprinting and enhance connector management
…connectors to prevent errors during upgrades
…ion, minimum app version, and license details; enhance queue management with debouncing and refactor status modal for clarity
…_INTERNAL_URL` for both next.js rewrite and docker network issues
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 21, 2026

@AnishSarkar22 is attempting to deploy a commit to the Rohan Verma's projects Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 21, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 7de28582-ce40-411b-82c4-294edc11bccc

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@recurseml recurseml Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review by RecurseML

🔍 Review performed on 2b6c39a..f98803a

✨ No bugs found, your code is sparkling clean

✅ Files analyzed, no issues (49)

.github/workflows/obsidian-plugin-lint.yml
.github/workflows/release-obsidian-plugin.yml
docker/.env.example
docker/docker-compose.yml
manifest.json
surfsense_backend/alembic/versions/129_obsidian_plugin_vault_identity.py
surfsense_backend/app/app.py
surfsense_backend/app/db.py
surfsense_backend/app/routes/__init__.py
surfsense_backend/app/schemas/obsidian_plugin.py
surfsense_backend/app/services/obsidian_plugin_indexer.py
surfsense_backend/tests/integration/test_obsidian_plugin_routes.py
surfsense_obsidian/.editorconfig
surfsense_obsidian/.gitignore
surfsense_obsidian/.npmrc
surfsense_obsidian/AGENTS.md
surfsense_obsidian/LICENSE
surfsense_obsidian/README.md
surfsense_obsidian/esbuild.config.mjs
surfsense_obsidian/eslint.config.mts
surfsense_obsidian/manifest.json
surfsense_obsidian/package.json
surfsense_obsidian/src/api-client.ts
surfsense_obsidian/src/excludes.ts
surfsense_obsidian/src/folder-suggest-modal.ts
surfsense_obsidian/src/main.ts
surfsense_obsidian/src/payload.ts
surfsense_obsidian/src/queue.ts
surfsense_obsidian/src/settings.ts
surfsense_obsidian/src/status-bar.ts
surfsense_obsidian/src/status-modal.ts
surfsense_obsidian/src/sync-engine.ts
surfsense_obsidian/src/types.ts
surfsense_obsidian/src/vault-identity.ts
surfsense_obsidian/styles.css
surfsense_obsidian/tsconfig.json
surfsense_obsidian/version-bump.mjs
surfsense_obsidian/versions.json
surfsense_web/.env.example
surfsense_web/app/api/zero/query/route.ts
surfsense_web/components/assistant-ui/connector-popup/connect-forms/components/obsidian-connect-form.tsx
surfsense_web/components/assistant-ui/connector-popup/connect-forms/connector-benefits.ts
surfsense_web/components/assistant-ui/connector-popup/connector-configs/components/obsidian-config.tsx
surfsense_web/components/assistant-ui/connector-popup/connector-configs/views/connector-edit-view.tsx
surfsense_web/components/assistant-ui/connector-popup/constants/connector-constants.ts
surfsense_web/components/assistant-ui/connector-popup/hooks/use-connector-dialog.ts
surfsense_web/lib/apis/connectors-api.service.ts
surfsense_web/next.config.ts
versions.json

⏭️ Files skipped (1)
  Locations  
surfsense_obsidian/package-lock.json

…e connection indicator styling in SurfSense plugin
- Added functionality to create and update notifications during the Obsidian sync process.
- Improved handling of sync completion and failure notifications.
- Updated connector naming convention in various locations for consistency.
@AnishSarkar22 AnishSarkar22 marked this pull request as ready for review April 22, 2026 01:10
@AnishSarkar22 AnishSarkar22 marked this pull request as draft April 22, 2026 08:01
…ian plugin

- Added a new Celery task for indexing non-markdown attachments.
- Enhanced the Obsidian plugin schema to support binary attachments.
- Updated routes to enqueue binary attachments for background processing.
- Improved metadata handling for binary attachments during indexing.
- Added tests for binary attachment processing and validation.
…port panels

- Updated styling for toggle buttons in DocumentsFilters for improved visual feedback.
- Added toolbar actions prop to PdfViewer for customizable actions in the zoom toolbar.
- Introduced download functionality in ReportPanel with a new Download icon.
- Refactored ReportCard to remove word count and display version labels for better clarity.
- Enhanced GenerateResume component to fetch and display version information for resumes.
- Changed plugin ID from "surfsense" to "surfsense-obsidian" for clarity.
- Updated version from "0.1.1" to "0.1.0" in manifest and versions files.
- Modified author URL to point to the official SurfSense website.
- Adjusted GitHub release workflow to ensure compatibility with Obsidian and BRAT.
…ugin

- Introduced an authentication block mechanism to prevent repeated invalid token submissions.
- Updated notification logic to provide clearer feedback on API token status.
- Refactored status visuals for better clarity and consistency in the user interface.
- Improved connection handling in the sync engine to ensure robust error management.
…logic

- Introduced a new `status-visuals.ts` file to centralize status icons and labels for consistency across the plugin.
- Updated connection indicator logic in the settings tab to utilize the new centralized visuals.
- Removed deprecated connection visual methods to streamline the codebase.
- Enhanced error handling in the status bar to reflect the new status visuals structure.
…ugin

- Changed initial status to "needs-setup" to prompt user configuration.
- Added a refreshStatus method to SyncEngine for immediate status updates after settings changes.
- Enhanced connection indicator logic in the settings tab to reflect the new status.
- Introduced "needs-setup" status visual for improved user feedback on configuration requirements.
- Added refreshStatus method to update connection status immediately after settings changes.
- Enhanced error reporting with reportAuthError method for better authentication feedback.
- Updated status visuals in the status modal to reflect the new centralized structure.
- Improved connection handling in the settings tab to ensure accurate status representation.
… handling

- Included server_time_utc in the connect response schema for better synchronization.
- Updated obsidian_connect function to set server_time_utc during connection handling.
- Enhanced integration tests to verify the presence of server_time_utc in responses.
- Improved connectivity status recovery in the sync engine for better error management.
@AnishSarkar22 AnishSarkar22 marked this pull request as ready for review April 24, 2026 22:42
…s components

- Updated icon imports and usages in AssistantMessage, CommentItem, CommentSheet, CommentThread, and InboxSidebar components.
- Enhanced visual consistency by standardizing the reply icon throughout the chat-related UI elements.
@MODSetter MODSetter merged commit f607636 into MODSetter:dev Apr 27, 2026
7 of 11 checks passed
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

Successfully merging this pull request may close these issues.

2 participants