You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add support for storage-backed (non-TEMP) SQLite triggers and tables for managed triggers. These resources persist on disk while in use and are automatically cleaned up when no longer claimed or needed. They should not be considered permanent triggers; PowerSync manages their lifecycle.
Managed triggers now use storage-backed (non-TEMP) SQLite triggers and tables when OPFS is the VFS. Resources persist across tabs and connection cycles to detect cross‑tab changes, and are automatically cleaned up when no longer in use. These should not be treated as permanent triggers; their lifecycle is managed by PowerSync.
* Manages claims on persisted SQLite triggers and destination tables to enable proper cleanup
466
+
* when they are no longer actively in use.
467
+
*
468
+
* When using persisted triggers (especially for OPFS multi-tab scenarios), we need a reliable way to determine which resources are still actively in use across different connections/tabs so stale resources can be safely cleaned up without interfering with active triggers.
469
+
*
470
+
* A cleanup process runs
471
+
* on database creation (and every 2 minutes) that:
472
+
* 1. Queries for existing managed persisted resources
473
+
* 2. Checks with the claim manager if any consumer is actively using those resources
474
+
* 3. Deletes unused resources
475
+
*/
476
+
477
+
exportinterfaceTriggerClaimManager{
478
+
/**
479
+
* Obtains or marks a claim on a certain identifier.
0 commit comments