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

Open
#996 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 2 days

@DivyanshGarg380 is already working on this.

Since Oct 31, 2026.

  • #997 by @DivyanshGarg380 — open

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
22/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
go, grpc
Domain
api, backend

Research direction

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.

Written by the indexing model from the issue text.

Description

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.

Dominant language
Go
Stars
247
Forks
16
Avg merge
2d 1h
Merged PRs (30d)
125

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from uber/submitqueue

All issues in uber/submitqueue

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.