Skip to content

Commit 614c251

Browse files
committed
Remove debug iterator.next() test - stream is working
The manual next() call proved the stream works (returned 198 bytes). Now removing the debug code to let the actual for-await loop consume messages properly.
1 parent f9ad4c0 commit 614c251

File tree

1 file changed

+0
-12
lines changed

1 file changed

+0
-12
lines changed

Sources/MCP/Client/Client.swift

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -200,18 +200,6 @@ public actor Client {
200200
NSLog("🔵 CLIENT: Got stream, starting for-await loop")
201201
// REMOVED: await logger?.debug() - causes actor boundary delay
202202

203-
// DEBUG: Try getting iterator explicitly
204-
NSLog("🔵 CLIENT: Creating stream iterator")
205-
var iterator = stream.makeAsyncIterator()
206-
NSLog("🔵 CLIENT: Iterator created, trying next()")
207-
208-
do {
209-
let firstElement = try await iterator.next()
210-
NSLog("🔵 CLIENT: next() returned: \(firstElement?.count ?? -1) bytes")
211-
} catch {
212-
NSLog("🔵 CLIENT: next() threw error: \(error)")
213-
}
214-
215203
do {
216204
for try await data in stream {
217205
NSLog("🔵 CLIENT: Received data in loop - \(data.count) bytes")

0 commit comments

Comments
 (0)