Skip to main content

Reservoir DevTools Reference

Overview​

ReservoirDevToolsOptions configures the local Redux DevTools integration supplied by Mississippi.Reservoir.Client.

Options​

OptionDefaultBehavior
EnablementOffSelects whether the service connects
NamenullNonblank value is forwarded as the extension instance name
MaxAgenullMaximum retained action count in DevTools history; forwarded as maxAge
LatencynullBatching latency in milliseconds; forwarded as latency
AutoPausenullWhen true, DevTools pauses while its window is not open; forwarded as autoPause
AdditionalOptionsEmpty dictionaryExtra extension options, applied after typed options
ActionSanitizernullOptional action-payload replacement
StateSanitizernullOptional state-payload replacement
SerializerOptionsWeb JSON defaults, case-insensitive property namesSerialization and restoration configuration
IsStrictStateRehydrationEnabledfalseRequires all registered features to be present and deserializable before applying a restored snapshot
ThrowOnMissingInitializernullOverrides the initialization checker's throw/warn choice when that hosted checker runs

An AdditionalOptions entry with the same key as a typed option replaces that key's outgoing value. Unset nullable forwarding options remain absent from the options payload; their extension-side defaults are owned by Redux DevTools.

Enablement​

ModeCondition
OffIntegration is disabled
AlwaysIntegration is enabled
DevelopmentOnlyInjected IHostEnvironment.IsDevelopment() is true

Use the WebAssembly setup recipe to select Always or Off from WebAssemblyHostBuilder.HostEnvironment explicitly. Keep service registration available for the initializer even when the selected mode is Off.

Prefer Off outside controlled development or diagnostic environments. Selecting Always permits ordinary action payloads and feature-state snapshots to reach the browser extension, which can also request local restoration. Enable it deliberately, choose what data may be exposed, and supply appropriate sanitizers for that environment.

Payloads​

The normal action payload has { type, payload }: type is the simple CLR class name (without its namespace), and payload is JSON serialized from the concrete action type. Actions with the same class name in different namespaces therefore share a DevTools label; use ActionSanitizer if the label must distinguish them. The normal state payload maps feature keys to JSON serialized from each concrete state type.

A non-null sanitizer result replaces that payload. A null result falls back to the normal payload. Sanitizers affect what the extension receives, so preserve the information needed for the debugging or restoration task you intend to perform.

Reporting runs without awaiting the task from dispatch. If a sanitizer throws InvalidOperationException, DevTools reporting catches it and drops that update. Other sanitizer exceptions can fault that unobserved reporting task; dispatch can still succeed without the DevTools update. Keep sanitizers predictable and handle or log their failures within the sanitizer.

Local State Restoration​

DevTools operationReservoir behavior
JUMP_TO_STATE, JUMP_TO_ACTIONDeserializes the supplied state into registered feature types; a rejected restore reinitializes DevTools history from the current store snapshot
RESETDispatches the system action that restores initial feature states, then reinitializes DevTools history
COMMITRecords the current local snapshot as the rollback point, then reinitializes DevTools history
ROLLBACKRestores the committed local snapshot, then reinitializes DevTools history
IMPORT_STATERestores the final computedStates entry's state when available, then reinitializes DevTools history

The store's system restoration path updates local feature state directly and can notify listeners. It bypasses ordinary user reducers, effects, and middleware. Use application commands for server-side business changes.

Reinitialization sends the current snapshot as the extension's new baseline, so save any action trace you need before using these commands. A successful jump does not reinitialize history. The committed snapshot copies the feature-key dictionary but retains references to feature state objects and nested values. Keep those object graphs immutable if ROLLBACK must reproduce values as they were at COMMIT; the service does not deep-copy them.

For JSON restoration, a missing feature, a null deserialized result, or a caught JsonException rejects the whole proposed restore in strict mode; default mode skips those entries and can apply the other valid features. FormatException and InvalidOperationException from parsing or conversion reject the entire restore in both modes. Other unhandled exceptions from a state type or converter, such as NotSupportedException, propagate from message processing. Extra input keys are outside the registered-feature iteration.

Strict validation applies to JSON restoration through JUMP_TO_STATE, JUMP_TO_ACTION, and the final imported snapshot from IMPORT_STATE. RESET restores registered initial state and ROLLBACK restores the in-memory committed snapshot through system actions; those operations do not use the JSON strict-validation path.

Preserve the exact casing of top-level feature keys in restoration JSON. Their lookup uses case-sensitive JsonElement.TryGetProperty; serializer case-insensitivity applies inside each feature value. A key with different casing is treated as missing under the selected restoration mode.

Initialization Diagnostics​

The root initializer starts observation after rendering and captures the initial rollback point. A later ordinary ActionDispatchedEvent triggers connection and reporting. Because this event follows reduction, the first action initializes the extension with its resulting state and then sends that action with the same state. The first DevTools entry therefore does not show the pre-action state; dispatch a harmless warm-up action before the transition you want to inspect.

If the extension is unavailable, each later ordinary action retries connection and can log another warning. Once marked connected, a caught JSException or InvalidOperationException during sending does not clear that flag, so later actions do not reconnect automatically. Reload the client after restoring the extension connection.

The registration also supplies a hosted initialization checker; in hosts that execute it, the default check delay is five seconds. An explicit ThrowOnMissingInitializer value controls its response; otherwise it throws in an injected Development host environment and logs a warning in other cases.

Source​

ReservoirDevToolsOptions, ReduxDevToolsService, initialization checker, and Store define these behaviors.

Summary​

DevTools exposes local actions and snapshots for inspection. Configure environment selection and payloads deliberately, and treat restoration as a local development operation.

Next Steps​

Enable DevTools in a WebAssembly client.