open-formulieren / open-forms

Smart and dynamic forms
https://open-forms.readthedocs.io
Other
35 stars 27 forks source link

If mail registration fails, revert submission status back to "failed" #4381

Open LaurensBurger opened 3 months ago

LaurensBurger commented 3 months ago

Thema / Theme

Admin

Omschrijving / Description

Haarlemmermeer: 153

in this example the registration email failed because of it's size (80mb) which was too much for the mail server to process: image It was marked as successful at 20:27, but at 20:28 a error occurred: SMTPServerDisconnected Server not connected

While OF is aware that this error has occurred (it's included in the digest and shown in the logs) the actual submission status does not reflect this.

Not updating the submission status might lead to data loss since the scrubbing of successful submission tends to be shorter compared to failed submissions.

sergei-maertens commented 3 months ago

Hrm, not trivial to fix since e-mail sending is done asynchronously, the only part the registration backend does is scheduling the email, but it doesn't know anything about the delivery succeeding or not :thinking:

A good suggestion though, we'll have to figure out a way to do this.

joeribekker commented 3 months ago

Refinement: So, while this is mostly a bug, its easy to work around by using our default configuration that sends links instead of attachments when files are too big. Treating this as enhancement. The functional fix is to set the submission status to failed (after it was set to successful when the initial mail sent)

Estimate: Few days because we need to tap into logging, maybe move it out of there into an event handling function (that both logs and sets registration status).