Skip to content

Queued emails: Handle non-submission saving webforms and cleanup #420

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

jekuaitk
Copy link
Contributor

@jekuaitk jekuaitk commented May 7, 2025

https://leantime.itkdev.dk/tickets/showKanban#/tickets/showTicket/4308

  • Hotfixes handling of webfoms that do not save submissions.
  • Added better error messages.
  • Updates advancedqueue

@jekuaitk jekuaitk force-pushed the hotfix/queued-email-fixes branch from 37b46cb to dab8451 Compare May 7, 2025 11:47
@jekuaitk jekuaitk requested a review from rimi-itk May 7, 2025 11:50

// Remove OS2Forms attachments.
foreach ($os2formsAttachmentFilenames as $os2formsAttachmentFilename) {
unlink($os2formsAttachmentFilename);
}

$msg = sprintf('Email, %s, sent to %s. Webform id: %s.', $message['subject'], $message['to'], $submission->getWebform()->id());
$msg = sprintf('Email, %s, sent to %s. Webform id: %s.', $payload['subject'] ?? NULL, $payload['to'] ?? NULL, $payload['webformId'] ?? NULL);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It may be worth moving this code before the file deletion to make sure that you only delete files if the job is succesful.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With our current knowledge we assume that it is exactly these two lines that cause the sporadic issue, i.e. the 'stuckness' in the processing state and subsequent re-processings. Moving this above deletion would result in subsequent job processes also sending emails.

Currently we have:

  • Sporadic false-positive failed jobs, i.e. the mail is sent.

If we move the code we would have:

  • Sporadic multiple emails sent

I'm not sure which is better.

@jekuaitk jekuaitk requested a review from rimi-itk May 7, 2025 12:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants