mirror of
https://github.com/johannesjo/super-productivity.git
synced 2026-07-18 17:05:48 +00:00
When a full-state op (SYNC_IMPORT/BACKUP_IMPORT) arrived from another client, mergeRemoteOpClocks reset the local clock to a "minimal" form but only preserved the current client's counter from the incoming op's clock. If the current client had issued ops (e.g. GLOBAL_CONFIG) not reflected in the incoming full-state op's clock, its counter was dropped, causing subsequent ops to reuse the same counter value. Downstream clients then saw these ops as EQUAL (duplicate) and skipped them silently. Fix: take max(mergedClock[clientId], currentClock[clientId]) when rebuilding the clock after a full-state op reset. Also add __SP_E2E_BLOCK_WS_DOWNLOAD flag to WsTriggeredDownloadService to allow E2E tests to block automatic WS-triggered downloads during concurrent conflict scenarios. Fix archive conflict test by blocking WS downloads on Client A during the concurrent edit phase so it doesn't auto-receive B's rename via WebSocket before archiving (restoring the intended conflict scenario). Fix LWW singleton test to assert convergence rather than specific winner. Fix renameTask helper to avoid Playwright/Angular re-render races. Fix shepherd.js import paths that broke the Angular dev server build. |
||
|---|---|---|
| .. | ||
| docs | ||
| scripts | ||
| src | ||
| .gitignore | ||
| .prettierrc.json | ||
| eslint.config.js | ||
| jest.config.cjs | ||
| jest.config.js.bak | ||
| package-lock.json | ||
| package.json | ||
| README.md | ||
| tsconfig.json | ||
| vite.config.ts | ||
Sync-MD Plugin v2.0.0
A SuperProductivity plugin that enables bidirectional synchronization between markdown files and project tasks.
Features
- Bidirectional Sync: Keep markdown files and SuperProductivity tasks in sync
- Batch API Integration: Efficient bulk operations for better performance
- Smart Debouncing: 10-second delays prevent conflicts during active editing
- Real-time Monitoring: File system watching with automatic sync triggers
- Task Hierarchy: Preserves parent-child relationships in markdown
- Modern Architecture: Built with Solid.js UI and modular TypeScript
Quick Start
# Install dependencies
npm install
# Development mode with hot reload
npm run dev:watch
# Build for production
npm run build
# Package as plugin
npm run package
Architecture
Core Components
src/fileWatcherBatch.ts- Main sync engine with batch API supportsrc/background.ts- Plugin lifecycle and message handlingsrc/App.tsx- Solid.js UI for configurationsrc/utils/- Reusable utilities (parser, debouncer, file ops)
Build System
build-proper.js- Main build scriptbuild-plugin.js- Package as distributable ZIPwatch-and-build.js- Development with auto-rebuild
Configuration
{
projectId: "project-uuid",
filePath: "/path/to/tasks.md",
syncDirection: "fileToProject" | "projectToFile" | "bidirectional"
}
Markdown Format
- [ ] Parent task
- [x] <!-- sp:task-id --> Completed subtask
- [ ] Pending subtask
Tasks are linked using HTML comments containing unique IDs.
Testing
# Run all tests
npm test
# Watch mode
npm run test:watch
# Coverage report
npm run test:coverage
Cleanup
To remove old/unnecessary files after updating:
chmod +x cleanup.sh
./cleanup.sh