You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Something claude flagged related to batch failures which I think will probably end up being out of scope for this PR. In the context of batches a single message failure rejects the entire batch and SQS would retry all of them.
Claude suggested that we could do better by adding support for batch failure reporting:
export const handler: SQSHandler = Sentry.wrapHandler(
async (event: SQSEvent) => {
const s3Client = new S3Client({ region: process.env["AWS_REGION"] ?? "" });
const results = await Promise.allSettled(
event.Records.map(async (message) => {
// ... existing per-message logic, but throw on failure ...
// (return message.messageId from .catch handlers, or just let throw propagate)
}),
);
const batchItemFailures = results
.map((r, i) =>
r.status === "rejected"
? { itemIdentifier: event.Records[i]!.messageId }
: null,
)
.filter((x): x is { itemIdentifier: string } => x !== null);
return { batchItemFailures };
},
);
Which apparently would also require some terraform changes to handle batch item failure reports:
Activity