fix: Incorrect type for SQS messageGroupId#1205
Conversation
| if (queueUrl.includes('.fifo')) { | ||
| messageParameters.MessageDeduplicationId = uuid(); | ||
| messageParameters.MessageGroupId = messageGroupId !== null ? messageGroupId : uuid(); | ||
| messageParameters.MessageGroupId = messageGroupId ?? uuid(); |
There was a problem hiding this comment.
Nullish coalescing treats both null and undefined as "omitted" values.
corinja
left a comment
There was a problem hiding this comment.
Do we know anywhere that existing code is explicitly passing in null and needs to be updated to pass in undefined?
Yeah, definitely some places (here's an example off the top of my head). However this won't cause any issues until we migrate those projects to TypeScript; the change is backwards-compatible in JS. |
|
Having said that I guess we could preserve |
corinja
left a comment
There was a problem hiding this comment.
Cool. Didn't mean to create more work with my previous comment! But this looks good.
|
All good; I needed to think about it more and resist breaking semver. It's tempting though when the breaking change is to fix something that was already broken! |
|
🎉 This PR is included in version 2.0.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
The current type is
null | undefined, which is unusable!I've changed this to
string | null | undefinedas a non-breaking step torwardsstring | undefined, with plans to remove thenulltype in v3.Also improves associated JSDoc.
Jira: ENG-3420