Accept hook_created in event batches so a run's boot hooks can go out in one write

Abierto
#5,449 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
25/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
typescript
Área
backend

Línea de trabajo

The request sits between the client batch path (createWorkflowRunEventBatch, which only rejects hook_received) and the backend batch route, which currently refuses hook_created with "Unsupported eventType 'hook_created' in an event batch". Start by reading the batch response validator, since it expects each item's event type to match its request and would reject a hook_created answered with hook_conflict. Done means the backend accepts hook_created batches with per-item conflict reporting and the validator accepts that response. This touches the backend service, so it needs maintainer input on the protocol before a first-timer should attempt it.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

A run's first delivery writes its boot suspension's events one at a time through the in-band writer. On the Vercel World, each hook_created is its own fenced POST (~50–80ms), and inline step claims wait behind them. eve creates a Workflow AbortController for its first turn at boot (one hook as of vercel/eve#6446, previously two), so every new session pays for that write before its first step can start. A message resumed into the run while those writes are in flight also waits for them.

I tried writing a suspension's plain hook creations (distinct tokens, no metadata, abort, force or dispose) as one createBatch from startSuspensionHookWrites. The backend refuses it:

Unsupported eventType 'hook_created' in an event batch

The client side already allows it: createWorkflowRunEventBatch only rejects hook_received. One gap there: the batch response validator expects each item's event type to match its request, so a hook_created answered with hook_conflict would fail validation, where the single-event path accepts it.

Would it be possible for the batch route to accept hook_created (and answer a taken token with a per-item hook_conflict)? With that, a boot's hooks and its inline step claims could go out as one write. Rough estimate from eve's boot traces: 50–150ms off a new session's first output, depending on how many hooks it creates.

🤖

Lenguaje dominante
TypeScript
Estrellas
2.5k
Forks
401
Merge medio
2 d 36 min
PR fusionados (30 d)
150

Preparar el entorno

  • Sin Dockerfile ni archivo de Docker Compose
  • Tiene una plantilla de pull request
  • Sin guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de vercel/workflow

Todos los issues de vercel/workflow

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.