Skip to content

Commit 496eee0

Browse files
committed
Revert "Fix #64: Ensure transport sends are bound to Session.current"
This reverts commit 9e6c742.
1 parent 9e6c742 commit 496eee0

File tree

1 file changed

+5
-15
lines changed

1 file changed

+5
-15
lines changed

Sources/SwiftMCP/Transport/Session.swift

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -227,9 +227,7 @@ extension Session {
227227

228228
let notification = JSONRPCMessage.notification(method: "notifications/progress",
229229
params: params)
230-
try? await self.work { _ in
231-
try await self.transport?.send(notification)
232-
}
230+
try? await transport?.send(notification)
233231
}
234232

235233
/// Send a log message notification to the client associated with this session, filtered by minimumLogLevel.
@@ -244,9 +242,7 @@ extension Session {
244242

245243
let notification = JSONRPCMessage.notification(method: "notifications/message",
246244
params: params)
247-
try? await self.work { _ in
248-
try await self.transport?.send(notification)
249-
}
245+
try? await transport?.send(notification)
250246
}
251247

252248
/// Send a roots/list request to the client and return the roots.
@@ -281,24 +277,18 @@ extension Session {
281277
/// Send a notification that the list of available tools changed.
282278
public func sendToolListChanged() async throws {
283279
let notification = JSONRPCMessage.notification(method: "notifications/tools/list_changed")
284-
try await self.work { _ in
285-
try await self.transport?.send(notification)
286-
}
280+
try await transport?.send(notification)
287281
}
288282

289283
/// Send a notification that the list of available resources changed.
290284
public func sendResourceListChanged() async throws {
291285
let notification = JSONRPCMessage.notification(method: "notifications/resources/list_changed")
292-
try await self.work { _ in
293-
try await self.transport?.send(notification)
294-
}
286+
try await transport?.send(notification)
295287
}
296288

297289
/// Send a notification that the list of available prompts changed.
298290
public func sendPromptListChanged() async throws {
299291
let notification = JSONRPCMessage.notification(method: "notifications/prompts/list_changed")
300-
try await self.work { _ in
301-
try await self.transport?.send(notification)
302-
}
292+
try await transport?.send(notification)
303293
}
304294
}

0 commit comments

Comments
 (0)