MCPcopy
hub / github.com/docker/docker-agent / persistedSessionID

Method persistedSessionID

pkg/tui/tabs.go:142–150  ·  view source on GitHub ↗

persistedSessionID returns the session-store ID that should be used for tuistate persistence for the given runtime tab ID. If the tab has a pending restore (session not yet lazily loaded), the persisted ID from pendingRestores is returned — this is the original session-store ID that was saved acros

(tabID string)

Source from the content-addressed store, hash-verified

140// session-store ID that was saved across restarts. Otherwise the live
141// session ID from the app is used.
142func (m *appModel) persistedSessionID(tabID string) string {
143 if persistedID, ok := m.pendingRestores[tabID]; ok {
144 return persistedID
145 }
146 if runner := m.supervisor.GetRunner(tabID); runner != nil {
147 return runner.App.Session().ID
148 }
149 return tabID
150}
151
152// findTabByPersistedID scans all open tabs and returns the runtime tab ID
153// whose persisted session-store ID matches the given ID. Returns "" if not found.

Callers 7

handleBranchFromEditMethod · 0.95
updateMethod · 0.95
handleLoadSessionMethod · 0.95
handleClearSessionMethod · 0.95
handleSwitchTabMethod · 0.95
handleReorderTabMethod · 0.95
handleCloseTabMethod · 0.95

Calls 2

GetRunnerMethod · 0.80
SessionMethod · 0.80

Tested by

no test coverage detected