DbInvalidationController
Controls SQLDelight query invalidations (notifyListeners).
Purpose: SQLDelight triggers notifyListeners() after most write operations, which can cause excessive recompositions, Flow emissions and cache invalidations when processing large batches of events.
This controller allows temporarily muting invalidations and aggregating them:
While muted, all
notifyListenerscalls are intercepted.Query keys are accumulated and deduplicated.
When the outermost mute scope finishes, all accumulated keys are flushed in a single
notifyListenerscall.
This significantly reduces UI / Flow churn during batch processing (e.g. Incremental Sync).