Outlook Mac: OnSend Event Loop Bug In Version 16.105
Hey everyone,
We've got a bit of a sticky situation here with the OnSend event in Outlook for Mac, specifically version 16.105. It seems to be looping like crazy when sending certain emails, even with the New Editor disabled. Let's dive into the details!
Environment
| Field | Value |
|---|---|
| Platform | Outlook for Mac |
| Outlook Version | 16.105 (26011018) - Released January 13, 2026 |
| OS | macOS |
| Feature | Office Add-in (OnSend Event) |
| New Editor | Disabled |
Issue Summary
So, the main problem? The OnSend event is being triggered multiple times in a loop when you're trying to send some emails. Yes, you read that right β a loop! It's kinda like that song you can't get out of your head, but way more annoying. Some of you might remember issue #6376, and this is similar, but here's the kicker: it's happening even when the New Editor is turned off. We've had multiple users reporting this on the latest Outlook for Mac version, so it's not just a one-off thing.
The OnSend event is a crucial part of Outlook add-ins, allowing developers to hook into the email sending process. When this event triggers repeatedly, it can cause significant issues, such as adding content multiple times or running validations in an endless loop, ultimately disrupting the user experience. Imagine sending an email and seeing the same disclaimer or classification added over and over β not a good look, right?
This looping behavior not only impacts the functionality of the add-in but also raises questions about the stability and reliability of the Outlook environment. It's essential to understand why this is happening, especially when the New Editor is disabled, as this was previously thought to be a primary cause of similar issues. Identifying the root cause will help in developing a proper fix and preventing this from happening again in future updates. For developers and users alike, a stable and predictable OnSend event is vital for ensuring a smooth and efficient email workflow.
Observed Behavior
Okay, so here's what we're seeing:
- A user composes a Reply/Forward email in Outlook Mac.
- The OnSend add-in kicks in and does its thing successfully.
- Outlook then triggers the OnSend event AGAIN after the mail is sent. Seriously, Outlook?
- This makes the add-in run multiple times in a loop. Think of it like a dog chasing its tail, but with code.
- The result? Classification/content gets added multiple times to the email body. Imagine seeing '[Confidential][Confidential][Confidential]' plastered all over your email. Not ideal!
Letβs break down the observed behavior a bit further. When a user composes an email, especially a reply or forward, the OnSend event is designed to trigger once before the email is actually sent. This allows add-ins to perform actions like content analysis, adding disclaimers, or enforcing compliance policies. However, the described scenario involves the OnSend event being triggered repeatedly after the initial execution, leading to a loop. This is not only unexpected but also highly problematic, as it can result in multiple iterations of the same action being applied to the email.
For instance, if the add-in is designed to add a confidentiality classification to the email body, the looping behavior causes this classification to be added multiple times, cluttering the email and potentially causing confusion. The fact that this issue is specific to certain mail threads and occurs primarily in reply/forward scenarios suggests that there may be something unique about these types of emails that triggers the repeated invocation of the OnSend event. Furthermore, the observation that copying and pasting the email body into a new email resolves the issue indicates that the problem may be related to the email's metadata or formatting, rather than the content itself.
Key Observations
- The issue happens without the "New Editor" option being enabled (unlike #6376).
- It's specific to certain mail threads, not all emails. It's picky, I guess.
- It pops up in Reply/Forward scenarios with existing classification headers. So, it's got a thing for replies and forwards.
- Add-in logs confirm that the process finishes successfully before being re-invoked. It's like the add-in is saying, "I'm done!" but Outlook is all, "One more time!".
- The re-invocation seems to be started by Outlook, not the add-in. It's Outlook pulling the strings here.
- The same issue DOESN'T happen when you copy-paste the same mail thread body into a freshly composed email. Go figure!
- Multiple users are running into this issue. It's a party, and no one's having fun.
Let's dig a bit deeper into these key observations. The fact that the issue persists even with the New Editor disabled is particularly important because it suggests that the root cause may be different from what was previously assumed. The New Editor was thought to be a significant factor in the looping behavior described in issue #6376, but this new evidence indicates that there may be another underlying problem. The specificity of the issue to certain mail threads and reply/forward scenarios also provides valuable clues. It suggests that the email's history, metadata, or the presence of existing headers may be contributing to the repeated invocation of the OnSend event.
The observation that the add-in logs confirm successful completion before the re-invocation rules out the possibility of the add-in itself being responsible for the loop. It also points to Outlook as the initiator of the repeated event triggering. The workaround of copying and pasting the email body into a new email is interesting because it highlights the potential role of the email's formatting or metadata in triggering the issue. By removing the original email's context and creating a new email with the same content, the problem is avoided, suggesting that the issue is not directly related to the email's content but rather to its associated data.
Expected Behavior
Ideally, the OnSend event should only be triggered once per send action. After the add-in does its job and calls event.completed({ allowEvent: true }), Outlook should chill out and not re-invoke the OnSend event. One and done, that's the motto!
The expected behavior of the OnSend event is crucial for maintaining the integrity and efficiency of Outlook add-ins. The event is designed to provide a single opportunity for add-ins to interact with the email sending process, allowing them to perform necessary actions such as content analysis, compliance checks, or adding disclaimers. Once the add-in has completed its tasks and signals that it is done by calling event.completed({ allowEvent: true }), Outlook should not re-trigger the event. This ensures that the add-in's actions are applied consistently and predictably, without causing unintended side effects or performance issues.
When the OnSend event is triggered multiple times, it violates this expected behavior and can lead to a variety of problems. As we've seen, it can result in content being added multiple times, creating clutter and confusion. It can also cause performance issues, as the add-in repeatedly performs the same tasks, consuming unnecessary resources. Moreover, it can disrupt the user experience, as the email sending process becomes unpredictable and unreliable. Therefore, it's essential that the OnSend event is triggered only once per send action, as intended, to ensure the proper functioning of Outlook add-ins and the overall stability of the email environment.
Workaround Tested
- β Copy-pasting the mail thread body to a freshly composed email stops the loop. It's like hitting the reset button.
- β No other workaround available right now. We're all ears if you have any ideas!
The workaround of copying and pasting the mail thread body into a freshly composed email provides a temporary solution for avoiding the looping behavior. By creating a new email with the same content, the problematic metadata or formatting associated with the original email is removed, preventing the repeated invocation of the OnSend event. However, this workaround is not ideal, as it requires users to manually copy and paste the email content, which can be time-consuming and inconvenient.
Moreover, it does not address the underlying issue of why the OnSend event is being re-triggered in the first place. A proper solution would involve identifying and fixing the root cause of the problem, rather than relying on a manual workaround. While the workaround can be helpful in certain situations, it is not a substitute for a comprehensive fix that ensures the OnSend event is triggered only once per send action, as intended.
Diagnostic Information
Incident ID: BPMKV97Y
Runtime logs are available if you need them.
Questions for Microsoft
- Why is the OnSend event being re-triggered after
event.completed({ allowEvent: true })is called? What gives? - Is this related to the same root cause as #6376, or is it a completely new beast?
- Why does this only happen on certain mail threads (Reply/Forward with existing headers)? What's so special about them?
- Is there a fix or patch in the works for this? We're eagerly waiting!
- Any tips or tricks to prevent this re-invocation? Manifest/code changes, maybe?
- Why does copying the content into a new compose window make the problem disappear? It's like magic!
Let's rephrase these questions to make them even clearer. First, we need to understand why the OnSend event is being re-triggered despite the add-in signaling its completion. This is crucial for identifying the source of the problem and preventing it from happening again. Second, it's important to determine whether this issue is related to the previously reported problem in #6376 or if it represents a new and distinct bug. This will help in focusing the investigation and applying the appropriate fix.
Third, we need to understand why the looping behavior is specific to certain mail threads, particularly those involving replies and forwards with existing headers. This suggests that there may be something unique about these types of emails that triggers the repeated invocation of the OnSend event. Fourth, we need to know if there is a fix or patch planned for this issue and when it is expected to be released. This will help users and developers plan accordingly and avoid the problems caused by the looping behavior. Fifth, we need to know if there are any recommended workarounds or code changes that can be implemented to prevent the re-invocation of the OnSend event. This will provide immediate relief to users who are experiencing the issue and allow them to continue using their add-ins without disruption. Finally, we need to understand why copying the email content into a new compose window resolves the issue. This may provide valuable clues about the root cause of the problem and help in developing a more effective solution.
Related Issue
Requested Action
Could you please investigate why Outlook is re-triggering the OnSend event after the add-in has finished its thing on the latest Outlook for Mac version (16.105), especially for those Reply/Forward scenarios? We'd really appreciate it!
Incident ID for diagnosis: BPMKV97Y
Let us know if you need any more logs or info to help you solve this puzzle. Thanks a bunch!