bbc / sqs-consumer

Build Amazon Simple Queue Service (SQS) based applications without the boilerplate
https://bbc.github.io/sqs-consumer/
Other
1.71k stars 330 forks source link

[Bug]: attributeNames does not support MessageSystemAttributeName #486

Closed leovvay closed 2 months ago

leovvay commented 2 months ago

Describe the bug

currently attributes name have a type definition of QueueAttributeName https://github.com/bbc/sqs-consumer/blob/main/src/types.ts#L15C3-L15C17, and missing MessageSystemAttributeName from clinet-sqs, which is actually supported by attributeNames with attributeNames: ['MessageGroupId', 'SentTimestamp'] as any, bypass

Your minimal, reproducible example

Consumer.create with attributeNames: ['MessageGroupId', 'SentTimestamp']

Steps to reproduce

  1. create a consumer via Consumer.create with attributeNames: ['MessageGroupId', 'SentTimestamp']
  2. observer type error
  3. change to attributeNames: ['MessageGroupId', 'SentTimestamp'] as any
  4. observer MessageGroupId actually received with this attribute names

Expected behavior

attributeNames type should support MessageSystemAttributeName from @aws-sdk/client-sqs

How often does this bug happen?

None

Screenshots or Videos

No response

Platform

macOs 14.4.1

Package version

v9.1.0

AWS SDK version

"@aws-sdk/client-sqs": "^3.556.0",

Additional context

No response

nicholasgriffintn commented 2 months ago

AWS' SQS SDK sets the type for attributes as QueueAttributeName https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/sqs/command/ReceiveMessageCommand/.

So it should be updated their side as this is made to match what the SDK actually sets as its expectation.

nicholasgriffintn commented 2 months ago

Update: I've actually found a related issue here: https://github.com/aws/aws-sdk-js-v3/issues/5403 so that might be one to follow.

github-actions[bot] commented 1 month ago

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.