MagicTelescopeIntegration class
Glues magic's Http / Model / Cache facades into the fluttersdk_telescope store.
Host integration (debug-only):
if (kDebugMode) {
TelescopePlugin.install();
MagicTelescopeIntegration.install();
}
Registers five units with TelescopePlugin:
- MagicHttpFacadeAdapter ; wraps Magic's
networkdriver with aMagicNetworkInterceptorthat feedsTelescopeStore.recordHttp(oracle's reuse-pattern decision kept inside magic). - MagicModelWatcher ; subscribes to
ModelCreated,ModelSaved,ModelDeletedand feedsTelescopeStore.recordMagicModel. - MagicCacheWatcher ; placeholder; magic's Cache facade does not currently emit lifecycle events. V1.x will land cache events upstream in magic's Cache layer; this watcher's install is a no-op for now (kept registered so the V1.x event wiring is a one-file change).
- MagicEventWatcher ; subscribes to the curated set of magic auth /
db / gate-definition events (alpha-2 scope) and feeds
TelescopeStore.recordEventwith an empty payload. Per-event field extraction is deferred to a follow-up alpha. - MagicGateWatcher ; subscribes to
GateAccessCheckedand feedsTelescopeStore.recordGatewith the canonical gate result shape (single dynamicargumentswrapped intoList<Object?>, user id stringified).
The five integration classes below are exposed for testing but are
NOT re-exported from package:magic/magic.dart ; only
MagicTelescopeIntegration.install is the documented public entry.
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 AND restores the three
cross-package function pointers (
pendingHttpCountReader,recentLogsReader,recentExceptionsReader) to their dusk-side missing-telescope 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.