localstack icon indicating copy to clipboard operation
localstack copied to clipboard

fix(11576): fixing bug in standardqueue put message

Open kshitijkohli opened this issue 1 year ago • 3 comments

Motivation

Raising a fix for an open issue in SQS flow of Localstack. Fixes #11576

Changes

There was a bug in Localstack SQS put message in Standard SQS flow. Principally, standard SQS put calls do not support messagegroupid parameter to be passed. Current implementation of localstack allows "" ie empty string to be passed as messagegroupid while publishing to localstack, whereas same api request to actual AWS sqs throws an exception. Added an additional check in code which checks messagegroupid should not be any string ( having values or empty ) in case of standard sqs put message. If the parameter is an instance of the string, throw exception

kshitijkohli avatar Oct 19 '24 20:10 kshitijkohli

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

localstack-bot avatar Oct 19 '24 20:10 localstack-bot

I have read the CLA Document and I hereby sign the CLA

kshitijkohli avatar Oct 19 '24 21:10 kshitijkohli

Hi @thrau , @baermat , @gregfurman Could you please add the semver: patch label to this PR? It contains a small, backward-compatible bug fix. I don't see the access to be able to add the labels. Thank you!

kshitijkohli avatar Oct 19 '24 21:10 kshitijkohli

@thrau Pushed the snapshot tests

kshitijkohli avatar Oct 20 '24 14:10 kshitijkohli

Hey @kshitijkohli 😄

When you ran your parity test, did you remember to point your client to snapshot against AWS? The relevant snippet of the contributing docs that Thomas linked is the How to write Parity tests:

Run the test against AWS: use the parameter --snapshot-update (or the environment variable SNAPSHOT_UPDATE=1) and set the environment variable as TEST_TARGET=AWS_CLOUD.

In addition, this section on Integration Testing (against AWS) is definitely also relevant!

Once you've setup your testing suite to be able to snapshot against AWS, you can run the test again with those flags enabled:

make TEST_TARGET=AWS_CLOUD SNAPSHOT_UPDATE=1 TEST_PATH="tests/aws/services/sqs/test_sqs.py::TestSqsProvider::test_send_message_to_standard_queue_with_empty_message_group_id"

Otherwise, I'd also be happy to generate the snapshot for you and push to your feature branch if that's something you'd prefer 🙂

gregfurman avatar Oct 21 '24 12:10 gregfurman