ALAppExtensions icon indicating copy to clipboard operation
ALAppExtensions copied to clipboard

Enqueue email not clear that if it is submitted in a transaction and error occurs all enqueued email is rolled back

Open tfbtrading opened this issue 5 years ago • 4 comments

This may be a feature and not a bug. However, we had an issue recently in which a process running was encountering an error with a single customer record as part of a batch report being run. For two weeks we hadn't realised that this email wasn't going out as the person was sending the email was triggering the report, getting up and leaving and by the time they returned the business central web client had timed out as so error message was not shown. The only way to know that it failed was to see that email wasn't in sent email table - however there is no record of a failed enqueue task that was rolled back.

tfbtrading avatar Mar 02 '21 19:03 tfbtrading

Thanks for reporting. We're going to see if we can reproduce this issue on our end!

JesperSchulz avatar Mar 03 '21 13:03 JesperSchulz

Hi @tfbtrading, could you provide a repro, the steps/sample code, the user did to enqueue the email?

darjoo avatar Mar 04 '21 08:03 darjoo

It’s myself Coa code in PTE we are running a report that itself generates out PDF and enqueues emails for a price list. I actually think the behaviour is fine. Rollback I mean. The issue is that as the session is timed out no error is seen on the screen and their is no log of what happened as it’s not associated with a job queue entry. It also didn’t show in last error info. Perhaps telemetry would show this error but I haven’t explored it and so operational issue was missed and I wouldn’t be the only one as in the past the smtp email was sent even if an error occurred.

Regards,

Russell Kallman TFB Trading Australia Landline: +61 3 9816 3444 Mobile: +61 408 440 663

(Sent from my mobile in a rush. Apologies in advance for any keyboard autocorrect errors)


From: Darrick [email protected] Sent: Thursday, March 4, 2021 7:14:07 PM To: microsoft/ALAppExtensions [email protected] Cc: Russell Kallman [email protected]; Mention [email protected] Subject: Re: [microsoft/ALAppExtensions] Enqueue email not clear that if it is submitted in a transaction and error occurs all enqueued email is rolled back (#11431)

Hi @tfbtradinghttps://github.com/tfbtrading, could you provide the steps the user did to enqueue the email?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/microsoft/ALAppExtensions/issues/11431#issuecomment-790416831, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AKFAGXQG3JTF5PPJ553BTN3TB46M7ANCNFSM4YPS3QLA.

tfbtrading avatar Mar 04 '21 08:03 tfbtrading

Sorry for the late reply as we have been busy with getting 18.0 ready. As you mentioned, the behavior is by design (rolling back). If you'd like to ensure that the enqueued email stays, you could do a commit right after enqueuing the email.

The old smtp sending always sent in the current session, and if you'd like the same behavior, using the Send procedure in the Email codeunit would do that. Enqueue procedure queues it up in the background to be run later(asap).

I'm not sure what is causing your timeout issue, but that would clear the last error since it'd be in a new session when you refresh. But also as you mentioned, if there was an error, telemetry would show it :)

I hope that helped. I'll close this bug but if you require more assistance, please reopen it.

darjoo avatar Mar 15 '21 07:03 darjoo