Use an Optional type for Event and Attempt fields that log store reads may skip

Abierto
#1,189 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 3 días

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
38/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
go
Área
api, backend

Línea de trabajo

Read the definitions of models.Event and models.Attempt and trace how their fields are marshalled through publish, delivery, MQ messages, filters, destination providers, and the API. Check the existing tests and benchmarks for JSON compatibility and delivery allocations. Done means the optional fields preserve the current wire format, distinguish unread from stored empty values, and meet the stated hot path constraint.

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

Descripción

Log store reads now take an Include option (#1187): ListAttempt reads Event.Data, Event.Metadata and Attempt.ResponseData only when the caller asks for them. So these fields on models.Event and models.Attempt can be absent, and are left nil.

The current types (json.RawMessage, maps) can already be nil, so this works. Nothing in the model says it can happen, though, and nil can't tell "not read" from "stored empty". A generic Optional[T] (Value T, Valid bool) on these three fields would make that visible while writing code: whoever reads the field handles the absent case on purpose. A caller that forgets Include today gets an empty value with no error; for example, a retry would deliver the event with no data. For now, #1187 adds a doc comment on each field.

Things to keep
  • Same wire format: models.Event and models.Attempt go through publish, delivery, MQ messages, filters (ParsedData), every destination provider and the API. Optional[T] must marshal as the inner value (or null) and unmarshal without changing the JSON.
  • Hot path: delivery reads Event.Data on every attempt. Marshalling must not add allocations or reflection.
Lenguaje dominante
Go
Estrellas
1.1k
Forks
70
Merge medio
3 d 9 h
PR fusionados (30 d)
34

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

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 hookdeck/outpost

Todos los issues de hookdeck/outpost

Issues similares

Más issues de Go

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.