@fgiova/sqs-consumer 2.1.3 → 2.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cjs/index.js CHANGED
@@ -126,13 +126,13 @@ class SQSConsumer {
126
126
  const candidatesToDelete = [];
127
127
  const candidateToRelease = [];
128
128
  for (const result of messagesResults) {
129
- if (result.result && this.handlerOptions.deleteMessage !== false) {
129
+ if (result.error) {
130
130
  // biome-ignore lint/style/noNonNullAssertion: ReceiptHandle must be present here
131
- candidatesToDelete.push(result.message.ReceiptHandle);
131
+ candidateToRelease.push(result.message.ReceiptHandle);
132
132
  }
133
- else if (result.error) {
133
+ else if (this.handlerOptions.deleteMessage !== false) {
134
134
  // biome-ignore lint/style/noNonNullAssertion: ReceiptHandle must be present here
135
- candidateToRelease.push(result.message.ReceiptHandle);
135
+ candidatesToDelete.push(result.message.ReceiptHandle);
136
136
  }
137
137
  if (candidatesToDelete.length)
138
138
  await this.sqsClient.deleteMessageBatch(this.queueARN, candidatesToDelete);
@@ -120,13 +120,13 @@ export class SQSConsumer {
120
120
  const candidatesToDelete = [];
121
121
  const candidateToRelease = [];
122
122
  for (const result of messagesResults) {
123
- if (result.result && this.handlerOptions.deleteMessage !== false) {
123
+ if (result.error) {
124
124
  // biome-ignore lint/style/noNonNullAssertion: ReceiptHandle must be present here
125
- candidatesToDelete.push(result.message.ReceiptHandle);
125
+ candidateToRelease.push(result.message.ReceiptHandle);
126
126
  }
127
- else if (result.error) {
127
+ else if (this.handlerOptions.deleteMessage !== false) {
128
128
  // biome-ignore lint/style/noNonNullAssertion: ReceiptHandle must be present here
129
- candidateToRelease.push(result.message.ReceiptHandle);
129
+ candidatesToDelete.push(result.message.ReceiptHandle);
130
130
  }
131
131
  if (candidatesToDelete.length)
132
132
  await this.sqsClient.deleteMessageBatch(this.queueARN, candidatesToDelete);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fgiova/sqs-consumer",
3
- "version": "2.1.3",
3
+ "version": "2.1.4",
4
4
  "main": "./dist/cjs/index.js",
5
5
  "types": "./dist/cjs/index.d.ts",
6
6
  "exports": {
@@ -44,7 +44,7 @@
44
44
  "access": "public"
45
45
  },
46
46
  "engines": {
47
- "node": ">=20.0.0"
47
+ "node": ">=20.14.1"
48
48
  },
49
49
  "tap": {
50
50
  "show-full-coverage": true,