Timestamp struct used in models.go seems incoherent with the used date format
I maintainer di solito rispondono entro 1 giorno
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 35/100
Direzione di ricerca
Leggi getstream-go/models.go e getstream/rfc3339.go, iniziando dai metodi Timestamp MarshalJSON e UnmarshalJSON. Confronta il loro input previsto con il formato del timestamp mostrato nell’issue e verifica il comportamento usando un payload di evento rappresentativo. Il lavoro è completato quando le date degli eventi possono essere deserializzate in modo coerente con il formato documentato.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Hi guys, I’m implementing a webhook handler that listens to GetStream Call events. To ease events payload unmarshaling, I’m trying to use the events structs in getstream-go/models.go. But it seems that the date type Timestamp is not coherent with the date format sent by Getstream in the events payloads.
type Timestamp struct {
Time *time.Time
}
func (t Timestamp) MarshalJSON() ([]byte, error) {
return json.Marshal(t.Time)
}
func (t *Timestamp) UnmarshalJSON(data []byte) error {
strData := string(data)
if strData == "null" {
return nil
}
ns, err := strconv.ParseInt(strData, 10, 64)
if err != nil {
return fmt.Errorf("failed to parse timestamp: %w", err)
}
utcT := time.Unix(0, ns).UTC()
t.Time = &utcT
return nil
}
With this implementation from getstream/rfc3339.go, the date format should be something like « 1739803521 » but the GetStream events payload contains the dates in that format: « 2025-02-13T16:45:22.746736895Z ».
So the UnmarshalJSON method can’t be used right away.
Is it the expected behavior?
- Lingua principale
- Go
- Stelle
- 8
- Fork
- 3
- Merge medio
- 29m
- PR unite (30g)
- 4
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di GetStream/getstream-go
-
Daily integration run is redAperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
GetStream/getstream-go#172 · 10 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 25/100
GetStream/getstream-go#25 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di GetStream/getstream-go
Issue simili
-
Logging into a locally started instance clears its container reference, causing stop to do nothingAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 79/100
microcks/microcks-cli#620 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
teradata-labs/loom#574 ·
I maintainer di solito rispondono entro 1 giorno
-
cli: name the CRID when saved link limits fail after publish; soften plain-republish mint warningApertaenhancement pr-polish-followup priority: low
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
layervai/qurl-integrations#1994 ·
I maintainer di solito rispondono entro 1 giorno
-
bug needs-acceptance wg/router-models-inference-runtime
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
vllm-project/semantic-router#5891 ·
I maintainer di solito rispondono entro 1 giorno
-
[Bug]: `Match exec "step ssh check-host %h"` causes SSH connections through ProxyJump to hangApertabug needs triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
I maintainer di solito rispondono entro 1 giorno