MagicCrumbsIntegration class

Glues magic's Http / Model / Cache / Log facades into the crumbs store.

Host integration (debug-only):

if (!kReleaseMode) {
  CrumbsPlugin.install();
  MagicCrumbsIntegration.install();
}

Registers seven units with CrumbsPlugin:

  1. MagicHttpFacadeAdapter ; wraps Magic's network driver with a MagicNetworkInterceptor that feeds CrumbsStore.recordHttp (oracle's reuse-pattern decision kept inside magic).
  2. MagicModelWatcher ; subscribes to ModelCreated, ModelSaved, ModelDeleted and feeds CrumbsStore.recordModel.
  3. MagicCacheWatcher ; subscribes to CacheHit, CacheMiss, CachePut, CacheForget and CacheFlush and feeds CrumbsStore.recordCache.
  4. MagicEventWatcher ; subscribes to the curated set of magic auth / db / gate-definition events and feeds CrumbsStore.recordEvent with an empty payload: the record carries the event type only.
  5. MagicGateWatcher ; subscribes to GateAccessChecked and feeds CrumbsStore.recordGate with the canonical gate result shape (single dynamic arguments wrapped into List<Object?>, user id stringified).
  6. MagicQueryWatcher ; subscribes to QueryExecuted and feeds CrumbsStore.recordQuery.
  7. MagicLogWatcher ; wraps the container's 'log' manager so every Log.* call after install also feeds CrumbsStore.recordLog.

The adapter and the six watchers are public and exported from package:magic_devtools/crumbs.dart, so a host can register a subset itself; MagicCrumbsIntegration.install registers all seven at once.

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Properties

isInstalled → bool
Whether install has been called at least once.
no setter

Static Methods

install() → void
Idempotent install. Safe to call multiple times within the same isolate lifetime.
resetForTesting() → void
Test-only reset. Drops the idempotency guard, puts back the log manager MagicLogWatcher wrapped, AND restores the three cross-package function pointers (pendingHttpCountReader, recentLogsReader, recentExceptionsReader) to their tapir-side missing-crumbs defaults so downstream tests that assert "graceful-empty" behavior do not see leaked bindings from a prior install call. The contract on each pointer is set-once-per-isolate during install + reset-on-resetForTesting.