super-productivity/packages/plugin-dev/sync-md/src
Johannes Millan c73eeff75b fix(sync-md): prevent crash from sync oscillation when adding subtask to markdown file
When a user adds a subtask by editing the markdown file directly, the
MD→SP sync creates the task which triggers SP hooks, which trigger
SP→MD sync, which writes the file, which the file watcher detects,
creating a rapid sync oscillation loop that crashes the app.

Three-layer fix:
1. Stop file watcher for the entire MD→SP sync duration and cancel
   pending SP→MD debounce timers
2. Add a cooldown after MD→SP sync (set before and after in finally
   block) to suppress SP hooks that fire as side-effects
3. Simplify lazySetInterval with async/await and a stopped flag to
   prevent zombie rescheduling when cancelled during async callbacks

Also fixes a file watcher race condition where polling could start
before initial mtime was resolved.

Fixes #6021
2026-03-24 14:12:50 +01:00
..
assets feat(sync-md): new approach and make it work better 2025-07-07 18:39:14 +02:00
background fix(sync-md): prevent crash from sync oscillation when adding subtask to markdown file 2026-03-24 14:12:50 +01:00
shared cleanup 2025-07-17 09:12:43 +02:00
ui Feat/plugin UI kit (#6362) 2026-02-04 18:18:22 +01:00
index.ts feat(syncMd): implement core markdown sync plugin with bidirectional synchronization 2025-07-10 14:55:44 +02:00
manifest.json build: update links to match our new organization 2026-01-05 14:45:06 +01:00
setupTests.ts feat(syncMd): add comprehensive test suite and development configuration 2025-07-10 14:56:19 +02:00
types.d.ts feat(syncMd): implement core markdown sync plugin with bidirectional synchronization 2025-07-10 14:55:44 +02:00