aws / aws-sdk

Landing page for the AWS SDKs on GitHub
https://aws.amazon.com/tools/
Other
68 stars 13 forks source link

ChangeVisibilityTimeoutBatch with VisibilityTimeout of 0 throws error #527

Closed atljoseph closed 9 months ago

atljoseph commented 1 year ago

Describe the bug

ChangeVisibilityTimeoutBatch does not act in the same way ChangeVisibilityTimeout does. When 0 is introduced as VisibilityTimeout (a valid value for placing a message back onto the queue), this error is thrown:

The request must contain the parameter ChangeMessageVisibilityBatchRequestEntry.VisibilityTimeout

Expected Behavior

ChangeVisibilityTimeoutBatch should accept the same VisibilityTimeout value as ChangeVisibilityTimeout.

Current Behavior

Error is thrown, when valid value is provided (see description).

The request must contain the parameter ChangeMessageVisibilityBatchRequestEntry.VisibilityTimeout

Reproduction Steps

Just send an api call with this input for

&sqs.ChangeMessageVisibilityBatchInput{
    Entries: []types.ChangeMessageVisibilityBatchRequestEntry{
                {
                        Id: "message-id-1",
                        ReceiptHandle: "message-handle-1",
                        VisibilityTimeout: int32(0),
                },
                {
                        Id: "message-id-2",
                        ReceiptHandle: "message-handle-2",
                        VisibilityTimeout: int32(0),
                },
                ...
        },
    QueueUrl: "http://aws.com/random-queue-url",
}

Error:

The request must contain the parameter ChangeMessageVisibilityBatchRequestEntry.VisibilityTimeout

Possible Solution

Accept same values in ChangeMessageVisibilityBatch as you do in ChangeMessageVisibility.

Additional Information/Context

No response

AWS Go SDK V2 Module Versions Used

github.com/aws/aws-sdk-go-v2 v1.17.5 github.com/aws/aws-sdk-go-v2/config v1.18.15 github.com/aws/aws-sdk-go-v2/service/sqs v1.19.17

Compiler and Version used

go1.19

Operating System and version

darwin/amd64

RanVaknin commented 1 year ago

Hi @atljoseph ,

I can confirm that this is a bug. It seems like its a serialization error, however I'm not sure why we are seeing it because the model is annotated correctly with the default trait.

RequestBody:

Action=ChangeMessageVisibilityBatch
&ChangeMessageVisibilityBatchRequestEntry.1.Id=REDACTED
&ChangeMessageVisibilityBatchRequestEntry.1.ReceiptHandle=REDACTED
&QueueUrl=REDACTED
&Version=2012-11-05

When it should be:

Action=ChangeMessageVisibilityBatch
&ChangeMessageVisibilityBatchRequestEntry.1.Id=REDACTED
&ChangeMessageVisibilityBatchRequestEntry.1.ReceiptHandle=REDACTED
&ChangeMessageVisibilityBatchRequestEntry.1.VisibilityTimeout=0
&QueueUrl=REDACTED
&Version=2012-11-05

Will investigate and get back to you,

Thanks, Ran~

RanVaknin commented 1 year ago

Hi @atljoseph ,

Seems like the service team needs a minor update to their model to get this to work correctly. I have opened an internal ticket and will keep you updated when it is fixed.

Thanks, Ran~

P84725366

atljoseph commented 1 year ago

Many thanksSent from my iPhoneOn Mar 29, 2023, at 4:02 PM, Ran Vaknin @.***> wrote: Hi @atljoseph , Seems like the service team needs a minor update to their model to get this to work correctly. I have opened an internal ticket and will keep you updated when it is fixed. Thanks, Ran~ P84725366

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>

RanVaknin commented 9 months ago

Hi @atljoseph ,

We have tried getting the SQS team to solve this but they are unable to prioritize this fix. If you willing, please cut an additional internal ticket to the SQS team via the AWS Console and reference the tracking ticket ID we already have with them P97774845, having a customer directly asking for remediation will help prioritization.

Since this is a duplicate of https://github.com/aws/aws-sdk/issues/261 I'll be closing this issue in favor of tracking it there.

Thanks, Ran~

github-actions[bot] commented 9 months ago

This issue is now closed.

Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.