🐛 Fix unbalanced parens in SSE response builder

The conflict resolution combining the *sink* binding with the
encode-fn negotiation dropped one closing paren, so the namespace
did not compile. Restore the missing closer.

AI-assisted-by: muse-spark-1.3-contributor
This commit is contained in:
Andrey Antukh 2026-11-02 10:47:17 +00:00
parent fb35c515a4
commit f1b0e07a8d

View File

@ -66,20 +66,19 @@
::yres/status 200
::yres/body (yres/stream-body
(fn [_ output]
(let [channel (sp/chan :buf buf :xf (keep (partial encode encode-fn)))
listener (events/spawn-listener
channel
(partial write! output)
(partial pu/close! output))]
(try
(binding [events/*sink* channel]
(try
(let [result (handler)]
(events/tap :end result))
(catch Throwable cause
(let [result (errors/handle' cause request)]
(events/tap :error result)))))
(finally
(sp/close! channel)
(px/await! listener))))))}))
(let [channel (sp/chan :buf buf :xf (keep (partial encode encode-fn)))
listener (events/spawn-listener
channel
(partial write! output)
(partial pu/close! output))]
(try
(binding [events/*sink* channel]
(try
(let [result (handler)]
(events/tap :end result))
(catch Throwable cause
(let [result (errors/handle' cause request)]
(events/tap :error result)))))
(finally
(sp/close! channel)
(px/await! listener))))))})))