This commit is contained in:
Frank 2025-08-17 16:59:03 +08:00
parent 6cf860be84
commit bc199d32be

View file

@ -461,15 +461,15 @@ async function subscribeSessionEvents() {
let text = ""
;(async () => {
while (true) {
console.log("!@#!@#!@#! reading...")
const { done, value } = await reader.read()
console.log("!@#!@#!@#! read", done, value)
if (done) break
const chunk = decoder.decode(value, { stream: true })
console.log("!@#!@#!@#! read", chunk)
const lines = chunk.split("\n")
for (const line of lines) {
console.log("!@#!@#!@#! line", line)
if (!line.startsWith("data: ")) continue
const jsonStr = line.slice(6).trim()