Inbox cancel returns 204 even when nothing was withdrawn
Los mantenedores suelen responder en 1 día
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 78/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- typescript
Línea de trabajo
Inspecciona packages/server/src/handlers/session.ts, especialmente session.inbox.cancel y el session.inbox.update correspondiente, y luego localiza las pruebas del handler de la bandeja de entrada de sesión. Reproduce la cancelación después de que se haya entregado un elemento y verifica que una retirada real siga siendo distinguible de un conflicto. El trabajo estará terminado cuando el comportamiento de la respuesta coincida con el contrato de API seleccionado y las pruebas relevantes cubran ambos casos.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Description
What happens. In v2.0.32, DELETE /api/session/:sessionID/inbox/:inboxID answers 204 No Content in two different situations:
- the pending item was withdrawn, so it will never reach the model;
- the item was no longer pending, for example because it had already been delivered to the session.
The handler catches the conflict and returns the same empty success (packages/server/src/handlers/session.ts, lines 551–559 at v2.0.32):
.handle(
"session.inbox.cancel",
Effect.fn(function* (ctx) {
yield* session.cancelInbox({ sessionID: ctx.params.sessionID, inboxID: ctx.params.inboxID }).pipe(
Effect.catchTag("Session.NotFoundError", missingSession),
Effect.catchTag("Session.InboxConflictError", () => Effect.void),
)
return HttpApiSchema.NoContent.make()
}),
)
The sibling session.inbox.update handler (line 564) sends the same InboxConflictError through pendingMutation, which answers 409 Conflict. Only cancel hides it.
Why it matters. A client that offers "undo my queued message" wants to put the withdrawn text back in the input box. Between the client's inbox read and the cancel, the running turn can end and the item can be delivered. The cancel still returns 204. If the client then restores the text, the person may send the same request again, although the first copy already ran. The client cannot tell the two cases apart:
- the item is absent from a fresh inbox read in both cases;
- the transcript proves delivery only when the message is in the page the client reads.
Request. Let the cancel response say what happened. For example:
- answer 409 Conflict for an item that is no longer pending, as
session.inbox.updatealready does, and keep 204 for a real withdrawal; or - if changing the status would break existing callers, return a small body such as
{ "withdrawn": true }or{ "withdrawn": false }.
Either form lets a client restore the text only after a real withdrawal, and otherwise point the person to the delivered message.
Plugins
None
OpenCode version
2.0.32
Steps to reproduce
- Start a reply that takes a few seconds.
- While it runs, queue a follow-up message. It appears in
GET /api/session/:sessionID/inbox. - Wait until the reply ends and the follow-up appears in
GET /api/session/:sessionID/message. - Send
DELETE /api/session/:sessionID/inbox/:inboxIDfor that follow-up. The answer is 204, the same as for a real withdrawal.
- Lenguaje dominante
- TypeScript
- Estrellas
- 215k
- Forks
- 28.9k
- Merge medio
- 6 h 8 min
- PR fusionados (30 d)
- 411
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de anomalyco/opencode
-
pending close triaging
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
anomalyco/opencode#57939 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
reproduced
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
anomalyco/opencode#57911 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
pending close triaging
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
anomalyco/opencode#57907 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
anomalyco/opencode#57855 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
opencode api truncates large output when stdout is a pipe (un-awaited write before process.exit)Abiertopending close triaging
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
anomalyco/opencode#57816 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de anomalyco/opencode
Issues similares
-
native
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
prime-radiant-inc/evener#4839 ·
Los mantenedores suelen responder en 1 día
-
bug needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
processone/fluux-messenger#1790 ·
Los mantenedores suelen responder en 1 día
-
🛣️ Infrastructure
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
opencrvs/opencrvs-core#14232 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
kunchenguid/gh-axi#220 ·
Los mantenedores suelen responder en 1 día