mirror of
https://github.com/johannesjo/super-productivity.git
synced 2026-07-18 17:05:48 +00:00
* feat(plugins): fire PERSISTED_DATA_CHANGED hook on persisted-data changes
Wires the dead PluginHooks.PERSISTED_DATA_UPDATE enum into a fired hook,
renamed PERSISTED_DATA_CHANGED. Plugins are notified when their persisted
data changes for any reason after the host's initial boot load — local
writes, remote incremental sync via bulkApplyOperations, and post-boot
wholesale loadAllData paths (SYNC_IMPORT / BACKUP_IMPORT / validation
repair / recovery).
Selector-based effect on selectPluginUserDataFeatureState, gated on
SyncTriggerService.afterInitialSyncDoneAndDataLoadedInitially$ so the
boot-time state seeds the pairwise baseline. Differ compares prev/next
by === on the encoded data blob (never decoded). Stage A composite
entityIds (pluginId:key) are normalized to owner pluginId and deduped
so a plugin with N keyed entries changing in one emission fires exactly
once. Per-pluginId dispatch via new PluginHooksService.dispatchHookToPlugin.
Effect is { dispatch: false } and creates no ops, so no sync-window
guard is needed — and adding one (skipDuringSyncWindow) would silently
suppress the very remote-sync deliveries the hook is designed to catch.
Closes #7754. Follow-up: doc-mode adoption tracked in #7752.
* test(plugins): tighten PERSISTED_DATA_CHANGED spec + docs
Multi-review pass 2 surfaced that the 5s timeout spec asserted only that
the dispatcher resolved — it would have silently passed if the timeout
race were removed entirely. Spy on PluginLog.err and assert the timeout
message actually reached the catch branch.
Also:
- Add `:` guard to PluginHooksService.registerHookHandler so the
persistence-key grammar is enforced at both the persistence and
hooks-registry endpoints (defense-in-depth; composeId already throws
at the bridge).
- Add async-rejected-promise spec to cover the Promise.race branch that
sync-throw didn't exercise.
- Carry the PERSISTED_DATA_CHANGED contract paragraph into
docs/plugin-development.md and docs/wiki/3.01-API.md (previously only
in packages/plugin-api/README.md).
- Clarify loadSyncedData(key?) in the README for keyed plugins.
|
||
|---|---|---|
| .. | ||
| assets | ||
| 0.-Meta-Diataxis.md | ||
| 0.00-Wiki-Structure-and-Organization.md | ||
| 0.01-Style-Guide.md | ||
| 0.02-Wiki-QA-and-Maintenance.md | ||
| 1.00-Quickstarts.md | ||
| 1.01-First-Steps.md | ||
| 1.02-Configure-Data-Synchronization.md | ||
| 2.00-How_To.md | ||
| 2.01-Downloads and Install.md | ||
| 2.02-Restore-Data-From-Backup.md | ||
| 2.03-Add-Tasks.md | ||
| 2.04-Manage-Subtasks.md | ||
| 2.05-Manage-Scheduled-Tasks.md | ||
| 2.06-Manage-Repeating-Tasks.md | ||
| 2.07-Manage-Task-Integrations.md | ||
| 2.08-Choose-Sync-Backend.md | ||
| 2.09-Configure-Sync-Backend.md | ||
| 2.10-Configure-Obsidian-for-Wiki-Contributions.md | ||
| 2.11-Run-the-Development-Server.md | ||
| 2.12-Package-the-App.md | ||
| 2.13-Run-with-Docker.md | ||
| 2.14-Build-for-Android.md | ||
| 2.15-Develop-a-Plugin.md | ||
| 2.16-Set-Up-Development-Environment.md | ||
| 2.17-Add-a-New-Issue-Integration.md | ||
| 2.18-Contribute-Translations.md | ||
| 3.00-Reference.md | ||
| 3.01-API.md | ||
| 3.02-Settings-and-Preferences.md | ||
| 3.03-Keyboard-Shortcuts.md | ||
| 3.04-Short-Syntax.md | ||
| 3.05-Web-App-vs-Desktop.md | ||
| 3.06-User-Data.md | ||
| 3.07-Issue-Integration-Comparison.md | ||
| 3.08-Sync-Integration-Comparison.md | ||
| 3.09-Theming.md | ||
| 3.97-Obsidian-Linter-Config-MD.md | ||
| 3.98-Obsidian-Linter-Config-YAML.md | ||
| 3.99-Other.md | ||
| 4.00-Concepts.md | ||
| 4.01-The-Today-View.md | ||
| 4.02-Inbox-View.md | ||
| 4.03-Planner-View.md | ||
| 4.04-Schedule-View.md | ||
| 4.05-Board-View.md | ||
| 4.06-Project-View.md | ||
| 4.07-Tag-View.md | ||
| 4.07a-Tags_Eat-the-Frog.md | ||
| 4.07b-Tags_Ordinal-Priorities.md | ||
| 4.08-Time-Estimates.md | ||
| 4.09-Task-Attributes.md | ||
| 4.10-Task-Notes.md | ||
| 4.11-Subtasks.md | ||
| 4.12-Scheduled-Tasks.md | ||
| 4.13-Repeating-Tasks.md | ||
| 4.14-How-Time-Is-Logged.md | ||
| 4.15-Timers-and-Focus-Mode.md | ||
| 4.16-Break-Reminders.md | ||
| 4.17-Idle-Time.md | ||
| 4.18-Reflection.md | ||
| 4.19-Metrics.md | ||
| 4.20-Task-Archiving.md | ||
| 4.21-Worklog.md | ||
| 4.22-Quick-History.md | ||
| 4.23-Managing-Your-Data.md | ||
| 4.24-Integrations.md | ||
| _Footer.md | ||
| _Sidebar.md | ||
| Home.md | ||