# ConnectionManagementSessionMixin

Auto-generated @jbrowse/mobx-state-tree API for the current JBrowse release —
see [pluggable elements](https://jbrowse.org/jb2-staging/docs/developer_guide/) for concepts. Built into
JBrowse core.
[View source](https://github.com/GMOD/jbrowse-components/blob/main/packages/product-core/src/Session/Connections.ts).

## Properties

<!-- prettier-ignore -->
| Member | Description |
| --- | --- |
| <span id="property-connectioninstances">**connectionInstances**</span><br><span class="cell-more"><button type="button" class="cell-more-trigger"><code>connectionInstances: types.stripDefault( types.array(pluginMana…</code></button><dialog class="cell-dialog"><form method="dialog"><button class="cell-dialog-close" aria-label="Close">✕</button></form><pre><code>connectionInstances: types.stripDefault(&#10;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;types.array(pluginManager.pluggableMstType('connection', 'stateModel')),&#10;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;[],&#10;&#160;&#160;&#160;&#160;&#160;&#160;)</code></pre></dialog></span> |  |
| <span id="property-connectiontrackconfigs">**connectionTrackConfigs**</span><br><span class="cell-more"><button type="button" class="cell-more-trigger"><code>connectionTrackConfigs: types.stripDefault( types.frozen&lt;Record…</code></button><dialog class="cell-dialog"><form method="dialog"><button class="cell-dialog-close" aria-label="Close">✕</button></form><pre><code>connectionTrackConfigs: types.stripDefault(&#10;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;types.frozen&lt;Record&lt;string, ConnectionTrackConfigEntry&gt;&gt;(),&#10;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;{},&#10;&#160;&#160;&#160;&#160;&#160;&#160;)</code></pre></dialog></span> | Persisted configs of connection tracks the user has opened, keyed by trackId. Unlike `connectionInstances` (stripped from snapshots, holds the whole fetched hub), this holds only the tracks in use, so an open connection track resolves synchronously on session load without re-establishing the connection. |

## Getters

<!-- prettier-ignore -->
| Member | Description |
| --- | --- |
| <span id="getter-connections">**connections**</span><br><span class="cell-more"><button type="button" class="cell-more-trigger"><code>(ModelInstanceTypeProps&lt;…&gt; &amp; { setSubschema(slotName: string, d…</code></button><dialog class="cell-dialog"><form method="dialog"><button class="cell-dialog-close" aria-label="Close">✕</button></form><pre><code>(ModelInstanceTypeProps&lt;…&gt; &amp; { setSubschema(slotName: string, data: Record&lt;string, unknown&gt;): any; setSlot(slotName: string, value: unknown): void; } &amp; IStateTreeNode&lt;...&gt;)[]</code></pre></dialog></span> |  |

## Actions

<!-- prettier-ignore -->
| Member | Description |
| --- | --- |
| <span id="action-makeconnection">**makeConnection**</span><br><span class="cell-more"><button type="button" class="cell-more-trigger"><code>(configuration: ModelInstanceTypeProps&lt;…&gt; &amp; {…} &amp; IStateTreeNod…</code></button><dialog class="cell-dialog"><form method="dialog"><button class="cell-dialog-close" aria-label="Close">✕</button></form><pre><code>(configuration: ModelInstanceTypeProps&lt;…&gt; &amp; {…} &amp; IStateTreeNode&lt;…&gt;, initialSnapshot?: object) =&gt; any</code></pre></dialog></span> |  |
| <span id="action-breakconnection">**breakConnection**</span><br><span class="cell-more"><button type="button" class="cell-more-trigger"><code>(configuration: ModelInstanceTypeProps&lt;…&gt; &amp; { setSubschema(slot…</code></button><dialog class="cell-dialog"><form method="dialog"><button class="cell-dialog-close" aria-label="Close">✕</button></form><pre><code>(configuration: ModelInstanceTypeProps&lt;…&gt; &amp; { setSubschema(slotName: string, data: Record&lt;…&gt;): any; setSlot(slotName: string, value: unknown): void; } &amp; IStateTreeNode&lt;…&gt;) =&gt; void</code></pre></dialog></span> | Remove a live connection instance. Tolerant of an already-dormant connection (its instance is stripped from the session on reload). Leaves persisted open-track configs alone — the connect() error path calls this and the user's already-open tracks must survive a transient failure. Full removal goes through `deleteConnection`. |
| <span id="action-teardownconnection">**teardownConnection**</span><br><span class="cell-more"><button type="button" class="cell-more-trigger"><code>(configuration: ModelInstanceTypeProps&lt;…&gt; &amp; { setSubschema(slot…</code></button><dialog class="cell-dialog"><form method="dialog"><button class="cell-dialog-close" aria-label="Close">✕</button></form><pre><code>(configuration: ModelInstanceTypeProps&lt;…&gt; &amp; { setSubschema(slotName: string, data: Record&lt;…&gt;): any; setSlot(slotName: string, value: unknown): void; } &amp; IStateTreeNode&lt;…&gt;) =&gt; void</code></pre></dialog></span> | Close every track a connection contributed — the live instance's tracks plus any persisted open-track configs (a dormant connection, never expanded this session, still renders its opened tracks from `connectionTrackConfigs`) — from all views/widgets, drop the live instance, and drop the persisted configs. The session is left as if the connection had never loaded. |
| <span id="action-deleteconnection">**deleteConnection**</span><br><span class="cell-more"><button type="button" class="cell-more-trigger"><code>(configuration: ModelInstanceTypeProps&lt;…&gt; &amp; { setSubschema(slot…</code></button><dialog class="cell-dialog"><form method="dialog"><button class="cell-dialog-close" aria-label="Close">✕</button></form><pre><code>(configuration: ModelInstanceTypeProps&lt;…&gt; &amp; { setSubschema(slotName: string, data: Record&lt;…&gt;): any; setSlot(slotName: string, value: unknown): void; } &amp; IStateTreeNode&lt;...&gt;) =&gt; any</code></pre></dialog></span> | Fully remove a connection: tear down its tracks and live instance, then delete its config. |
| <span id="action-addconnectionconf">**addConnectionConf**</span><br><code>(connectionConf: AnyConfiguration) =&gt; any</code> | Adds to the **config**, not the session: `jbrowse.connections`, which every visitor to this instance loads. jbrowse-web overrides this so a non-admin's connection lands in `sessionConnections` instead — see WebSessionConnectionsMixin, whose `addSessionConnectionConf` is what to call when you mean the session specifically rather than "wherever this user's edits go".<br><br>Applications without that override (Desktop, the embedded products) have only this one destination, and it is the right one there: their config and session are saved as a single document. |
| <span id="action-clearconnections">**clearConnections**</span><br><code>() =&gt; void</code> |  |
| <span id="action-captureconnectiontrack">**captureConnectionTrack**</span><br><code>(trackId: string) =&gt; void</code> | Snapshot a just-opened connection track's config into `connectionTrackConfigs` so it survives session reload. No-op if the track isn't connection-provided or is already captured (edits go through `updateConnectionTrackConfig`). |
| <span id="action-updateconnectiontrackconfig">**updateConnectionTrackConfig**</span><br><span class="cell-more"><button type="button" class="cell-more-trigger"><code>(trackConf: Record&lt;string, unknown&gt; &amp; { trackId: string; }) =&gt;…</code></button><dialog class="cell-dialog"><form method="dialog"><button class="cell-dialog-close" aria-label="Close">✕</button></form><pre><code>(trackConf: Record&lt;string, unknown&gt; &amp; { trackId: string; }) =&gt; void</code></pre></dialog></span> | Persist an edit to an opened connection track. The full config is stored (not a delta): the connection's fetched "base" isn't present at load, so only a complete config resolves synchronously. |
| <span id="action-setconnectiontrackconfig">**setConnectionTrackConfig**</span><br><span class="cell-more"><button type="button" class="cell-more-trigger"><code>(trackId: string, connectionId: string, config: Record&lt;string,…</code></button><dialog class="cell-dialog"><form method="dialog"><button class="cell-dialog-close" aria-label="Close">✕</button></form><pre><code>(trackId: string, connectionId: string, config: Record&lt;string, unknown&gt;) =&gt; void</code></pre></dialog></span> | Upsert one opened connection track's persisted config. |
| <span id="action-pruneconnectiontrackconfig">**pruneConnectionTrackConfig**</span><br><code>(trackId: string) =&gt; void</code> | Drop a connection track's persisted config once no open view still references it, so the session doesn't accumulate closed tracks. |
| <span id="action-hydrateconnection">**hydrateConnection**</span><br><code>(connectionId: string) =&gt; void</code> | Lazily establish a single connection by id if it isn't already live — used when its category is expanded in the track selector. Fetches silently (no view launch / success snackbar); already-open tracks keep rendering from `connectionTrackConfigs` meanwhile. Idempotent. |

