super-productivity/packages/plugin-dev/sync-md/src
Johannes Millan f9fd8454cc fix(sync-md): prevent crash when adding subtasks to markdown file directly
Fixes #6021

When users manually added subtasks to markdown files that referenced
non-existent parent tasks, the plugin would crash due to unsafe null
assertions and missing validation. This made the plugin permanently
disabled and required creating a new markdown file to recover.

Changes:
- Added parent ID validation before creating operations
- Orphaned subtasks are now converted to root tasks with warnings
- Added comprehensive error handling with user notifications
- Plugin stays enabled even after sync errors
- Added 15 new tests (689 lines) for orphaned subtask scenarios
- Fixed all existing tests to support new error notifications

The fix implements defense-in-depth:
1. Validation layer: Check parent IDs exist before operations
2. Error handling: Catch and report errors without crashing
3. User feedback: Clear notifications about issues
4. Data preservation: No data loss, orphans become root tasks
2026-01-16 13:28:05 +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 when adding subtasks to markdown file directly 2026-01-16 13:28:05 +01:00
shared cleanup 2025-07-17 09:12:43 +02:00
ui feat: add open sans as default font 2025-09-04 18:30:09 +02: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