entitlementInvalidationWatcherProvider top-level property

  1. @ProviderFor.new(entitlementInvalidationWatcher)
FutureProvider<void> entitlementInvalidationWatcherProvider
final

Background watcher that subscribes to Supabase Realtime on the admin_grants and subscriptions tables and invalidates the cached currentEntitlementsProvider on any change. RLS still filters which rows the client receives — only grants/subs targeting the current user (or their org, as an admin) will trigger an event.

The watcher is lifecycle-managed: it subscribes on the first read, tears down on provider dispose, and rebuilds when auth state changes so a sign-in/sign-out cleanly swaps the user context.

Wire into the app by reading the provider once at startup (e.g. from main.dart's _initServicesAsync). Reading it is enough — the side effect is the subscription.

Copied from entitlementInvalidationWatcher.

Implementation

@ProviderFor(entitlementInvalidationWatcher)
final entitlementInvalidationWatcherProvider = FutureProvider<void>.internal(
  entitlementInvalidationWatcher,
  name: r'entitlementInvalidationWatcherProvider',
  debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
      ? null
      : _$entitlementInvalidationWatcherHash,
  dependencies: null,
  allTransitiveDependencies: null,
);