feat: enable type-aware no-floating-promises rule, fix all 177 violations (#22741)

This commit is contained in:
Kit Langton
2026-04-15 23:27:32 -04:00
committed by GitHub
parent 343a564183
commit 80f1f1b5b8
103 changed files with 212 additions and 187 deletions

View File

@@ -898,7 +898,7 @@ export const SessionRoutes = lazy(() =>
const msg = await AppRuntime.runPromise(
SessionPrompt.Service.use((svc) => svc.prompt({ ...body, sessionID })),
)
stream.write(JSON.stringify(msg))
void stream.write(JSON.stringify(msg))
})
},
)
@@ -926,13 +926,15 @@ export const SessionRoutes = lazy(() =>
async (c) => {
const sessionID = c.req.valid("param").sessionID
const body = c.req.valid("json")
AppRuntime.runPromise(SessionPrompt.Service.use((svc) => svc.prompt({ ...body, sessionID }))).catch((err) => {
log.error("prompt_async failed", { sessionID, error: err })
Bus.publish(Session.Event.Error, {
sessionID,
error: new NamedError.Unknown({ message: err instanceof Error ? err.message : String(err) }).toObject(),
})
})
void AppRuntime.runPromise(SessionPrompt.Service.use((svc) => svc.prompt({ ...body, sessionID }))).catch(
(err) => {
log.error("prompt_async failed", { sessionID, error: err })
void Bus.publish(Session.Event.Error, {
sessionID,
error: new NamedError.Unknown({ message: err instanceof Error ? err.message : String(err) }).toObject(),
})
},
)
return c.body(null, 204)
},

View File

@@ -76,7 +76,7 @@ const app = (upgrade: UpgradeWebSocket) =>
queue.length = 0
}
remote.onmessage = (event) => {
send(ws, event.data)
void send(ws, event.data)
}
remote.onerror = () => {
ws.close(1011, "proxy error")