Skip to content

Commit

Permalink
Merge pull request #322 from guardian/email-lambda/log-potential-race…
Browse files Browse the repository at this point in the history
…-condition

log error if the email-lambda is invoked directly/instantly for a group mention but then the logic concludes that there are "No items to email about"
  • Loading branch information
twrichards authored Nov 21, 2024
2 parents aa3ff0d + 2dc3d35 commit c1b9f98
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions email-lambda/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,15 @@ export const handler = async (maybeSendImmediatelyDetail?: {
* will need their isEmailEvaluated flag set to true at the bottom
* of this file, so they aren't continually picked up
*/

if (itemIdWithGroupMention) {
console.error(
"Item with ID",
itemIdWithGroupMention,
"has no group mentions to email about. This is unexpected.",
{ itemsToEmailAbout }
);
}
}

if (itemsToEmailAbout.length === 0) {
Expand Down

0 comments on commit c1b9f98

Please sign in to comment.