Skip to content
This repository has been archived by the owner on Nov 5, 2024. It is now read-only.

ChangeVisibilityTimeoutBatch with VisibilityTimeout of 0 throws error #527

Closed
atljoseph opened this issue Mar 28, 2023 · 8 comments
Closed
Assignees
Labels
bug Something isn't working service-api This issue pertains to the AWS API

Comments

@atljoseph
Copy link

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

@atljoseph atljoseph added bug Something isn't working needs-triage labels Mar 28, 2023
@RanVaknin
Copy link

RanVaknin commented Mar 29, 2023

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
Copy link

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

@RanVaknin RanVaknin added service-api This issue pertains to the AWS API and removed needs-review labels Mar 29, 2023
@atljoseph
Copy link
Author

atljoseph commented Mar 30, 2023 via email

@RanVaknin
Copy link

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 #261 I'll be closing this issue in favor of tracking it there.

Thanks,
Ran~

@github-actions
Copy link

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.

@jfrconley
Copy link

This issue is still present

I'm a little confused what has been blocking what seems like a very simple fix, would it be possible to check with SQS team again? @RanVaknin

@lucix-aws
Copy link

We've had difficulty in the past when communicating with service teams about these issues. Often, from their perspective, the issue doesn't manifest in the SDKs they're familiar with (generally Java, JS, etc.) and so they're hesitant to commit modeling changes because the impact isn't necessarily fully understood. Between that, and other things getting prioritized, these discussions with service teams often start and then eventually stale out.

This particular issue and many like it are only going to affect SDKs with explicit nullability/optionality in their type systems, so generally

  • Go v2
  • Rust
  • Kotlin

We're reframing our strategy when dealing with these service teams going forward, but for the Go SDK in particular, we're going to just start backfilling modeling fixes locally. So, for this issue, we're going to mark ChangeMessageVisibilityBatchRequestEntry.VisibilityTimeout as @required in our own SDK, such that the SDK always sends it.

That's ultimately a stopgap, but it's minimal effort and it unblocks our customers. We still need to do our best internally and push teams to fix issues like this at the service level, but we shouldn't let perfect be the enemy of good here.

@lucix-aws
Copy link

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working service-api This issue pertains to the AWS API
Projects
None yet
Development

No branches or pull requests

4 participants