Skip to content

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

Open

Description

@DivyanshGarg380

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions