Mail App shows outdated error popup

We have a MailExtension using new Apple MailKit API. The extension returns an error from the SecurityHandler's Encode Method based on certain conditions and If an error is reported during mail send 3/4 times, even after user performed a corrective action and hits send again, the same error is is shown by Mail again for couple more times.

The attached sample mail extension project returns an error after hitting send if subject line of the mail is “Show Alert”. If we repeat the error 3/4 times then even after changing the subject line the error is reported once or twice more.

it is an Apple issue as per our investigation. After the subject line is changed in the mail, each time security handler’s encodeMessage is called, we return it successfully and no error is returned to Apple. Still the old error pop-up appears. I think this is a gap in sync between the remote process that loads the extension and actual Mail.app process. It takes a bit of time to reflect the status of encoding to Mail.app from the remote helper process. This is a timing issue, depends on how fast you keep bombarding the Send. After making the correction of the erroneous condition (in this sample, the subject line) if you wait for ten seconds and then hit ‘Send’ the issue doesn't happen. which suggests its a timing sync issue at Apple end.

Anyone else seeing this?

Mail App shows outdated error popup
 
 
Q