[Bug] Land returns codes.Unknown instead of InvalidArgument for an unrecognized strategy

Aperta
#996 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

@DivyanshGarg380 ci sta già lavorando.

Dal 31/10/2026.

  • #997 di @DivyanshGarg380 — aperta

Valutazione

Difficoltà
1/5
Tempo stimato
Meno di un'ora
Idoneità per principianti
22/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
go, grpc
Ambito
api, backend

Direzione di ricerca

Start in service/submitqueue/gateway/server/mapper/land.go, where ProtoToLandRequest and resolveLandStrategy return a plain fmt.Errorf for an unknown strategy. Then check gatewayStatusError to see how it classifies errors via controller.IsInvalidRequest. Done means the mapper error is wrapped as a user error so status.Code(err) returns InvalidArgument. Pull request #997 is already open against this, so check it before starting.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug

Description

SubmitQueueGateway.Land called with an unrecognized Strategy enum value (for example one sent by a newer client) is answered with gRPC Unknown instead of InvalidArgument. mapper.ProtoToLandRequest returns a plain fmt.Errorf, and gatewayStatusError passes unclassified errors through unchanged, so gRPC reports Unknown. Every other invalid-input error from Land is classified as a user error and surfaces as InvalidArgument.

Steps to Reproduce

  1. Start the local stack (make local-submitqueue-start).
  2. Call SubmitQueueGateway.Land with a configured queue, a valid change URI, and Strategy: mergestrategypb.Strategy(9999).
  3. Inspect status.Code(err).

Expected Behavior

codes.InvalidArgument, consistent with the gateway's other invalid-input errors.

Actual Behavior

codes.Unknown, with the message failed to map land strategy: unknown land strategy in proto message: 9999.

Environment

  • Go version: go1.27.1
  • OS: Windows
  • Bazel version: 8.4.1

Additional Context

resolveLandStrategy and ProtoToLandRequest are in service/submitqueue/gateway/server/mapper/land.go. errs.NewUserError already matches controller.IsInvalidRequest in gatewayStatusError, so wrapping the mapper error is enough. I have a fix ready.

Lingua principale
Go
Stelle
247
Fork
16
Merge medio
2g 1h
PR unite (30g)
125

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di uber/submitqueue

Tutte le issue di uber/submitqueue

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.