Fix Edit/Save not applying to an already-connected External MCP server
ExternalMCPManager.reconfigure() only started brand-new clients — a server ID that already had a client (in ANY state, including .crashed) was silently skipped even when its settings had just changed. Editing a server in Settings and clicking Save persisted correctly but never reached the live connection, which just kept running with its old (often broken) config until the next app launch. Rune hit this directly editing Obsidian's URL/token after the toggle-fields bug corrupted it. Added ExternalMCPServer: Equatable so reconfigure can detect a changed config for a still-enabled server and restart it fresh (extracted the restart-attempt-reset logic already used by retryClient into a shared restartFresh helper).
This commit is contained in:
@@ -14,7 +14,7 @@ nonisolated enum MCPTransportKind: String, Codable, Sendable, CaseIterable {
|
||||
case http
|
||||
}
|
||||
|
||||
nonisolated struct ExternalMCPServer: Codable, Identifiable, Sendable {
|
||||
nonisolated struct ExternalMCPServer: Codable, Identifiable, Sendable, Equatable {
|
||||
var id: UUID
|
||||
var name: String
|
||||
var transportKind: MCPTransportKind
|
||||
|
||||
Reference in New Issue
Block a user