Erratic Behavior In AddFileAttachmentAsync And RemoveAttachmentAsync In Outlook New UI For Mac
Introduction
As developers, we strive to create seamless and reliable experiences for our users. However, sometimes, we encounter issues that can be frustrating and impact the overall user experience. In this article, we will discuss a specific issue related to the addFileAttachmentAsync
and removeAttachmentAsync
functions in the Outlook New UI for Mac. We will delve into the expected behavior, current behavior, and steps to reproduce the issue, as well as provide additional details and context.
Your Environment
Before we dive into the issue, let's outline the environment in which we encountered this problem:
- Platform: Mac
- Host: Outlook New UI
- Office version number: Tested on 16.95.3
- Operating System: Tested on macOS 15.1
Expected behavior
When using the addFileAttachmentAsync
and removeAttachmentAsync
functions, we expect the following behavior:
- addFileAttachmentAsync: This function should consistently add file attachments to the email and return a success status only when the operation is completed successfully.
- removeAttachmentAsync: This function should consistently remove file attachments from the email and return a success response only when the operation is completed successfully.
Current behavior
Unfortunately, on Mac with the new Outlook UI, we observed the following erratic behavior:
- Sometimes, attachments are not added: Despite receiving an
OK
status fromaddFileAttachmentAsync
, attachments are not added to the email. - Similarly, attachments are not removed: Even when
removeAttachmentAsync
returns a success response, attachments are not removed from the email.
Steps to reproduce
To reproduce this issue, follow these steps:
- Create an Outlook add-in: Develop an Outlook add-in that uses
addFileAttachmentAsync
andremoveAttachmentAsync
wrapped in JavaScript promises. - Test the functionality on different platforms:
- Web: Test the add-in on web platforms (e.g., Edge, Chrome, Safari, Firefox) to ensure it works as expected.
- Windows: Test the add-in on Windows platforms (e.g., Outlook classic and new UI) to ensure it works as expected.
- Mac New UI: Test the add-in on Mac with the new Outlook UI to observe the erratic behavior.
- Observe the behavior: Note that attachments occasionally fail to be added or removed, even though the functions report success.
Link to live example(s)
Unfortunately, this issue occurs inconsistently, making it difficult to provide a reliable live example. However, we have reported related issues on GitHub:
- Issue 2680: GitHub issue 2680
- Issue 2490: GitHub issue 2490
Provide additional details
To better understand the issue, here are some additional details:
- Encapsulating calls in JavaScript promises: We encapsulate the
addFileAttachmentAsync
andremoveAttachmentAsync
calls in JavaScript promises to improve control readability in our codebase. - Inconsistent behavior on Mac New UI: The erratic behavior is specific to Mac with the new Outlook UI and does not manifest on other platforms.
Context
This issue affects our users who rely on Mac with the new Outlook UI. The inability to consistently add or remove attachments reduces trust in the add-in's functionality and impacts the user experience.
Useful logs
To help diagnose the issue, please provide the following logs:
- Console errors: Any console errors related to the issue.
- Screenshots: Screenshots of the issue, including the email and attachment.
- Test file: A test file that reproduces the issue.
Introduction
In our previous article, we discussed the erratic behavior of addFileAttachmentAsync
and removeAttachmentAsync
in the Outlook New UI for Mac. We outlined the expected behavior, current behavior, and steps to reproduce the issue. In this article, we will address some frequently asked questions (FAQs) related to this issue.
Q: What is the expected behavior of addFileAttachmentAsync and removeAttachmentAsync?
A: The expected behavior of addFileAttachmentAsync
and removeAttachmentAsync
is to consistently add and remove file attachments, respectively, and return a success status only when the operation is completed successfully.
Q: What is the current behavior of addFileAttachmentAsync and removeAttachmentAsync on Mac with the new Outlook UI?
A: On Mac with the new Outlook UI, addFileAttachmentAsync
and removeAttachmentAsync
sometimes fail to add or remove attachments, even though the functions report success.
Q: Why is this issue specific to Mac with the new Outlook UI?
A: The erratic behavior is specific to Mac with the new Outlook UI and does not manifest on other platforms, such as web or Windows.
Q: How can I reproduce this issue?
A: To reproduce this issue, follow these steps:
- Create an Outlook add-in that uses
addFileAttachmentAsync
andremoveAttachmentAsync
wrapped in JavaScript promises. - Test the functionality on different platforms:
- Web: Test the add-in on web platforms (e.g., Edge, Chrome, Safari, Firefox) to ensure it works as expected.
- Windows: Test the add-in on Windows platforms (e.g., Outlook classic and new UI) to ensure it works as expected.
- Mac New UI: Test the add-in on Mac with the new Outlook UI to observe the erratic behavior.
- Observe the behavior: Note that attachments occasionally fail to be added or removed, even though the functions report success.
Q: What are some related issues on GitHub?
A: We have reported related issues on GitHub:
- Issue 2680: GitHub issue 2680
- Issue 2490: GitHub issue 2490
Q: How can I provide useful logs to help diagnose this issue?
A: To help diagnose the issue, please provide the following logs:
- Console errors: Any console errors related to the issue.
- Screenshots: Screenshots of the issue, including the email and attachment.
- Test file: A test file that reproduces the issue.
Q: What is the impact of this issue on users?
A: This issue affects users who rely on Mac with the new Outlook UI. The inability to consistently add or remove attachments reduces trust in the add-in's functionality and impacts the user experience.
Q: How can I stay updated on the status of this issue?
A: We recommend the related GitHub issues and checking the Microsoft Office Dev Center for updates on this issue.
By addressing these FAQs, we hope to provide a better understanding of the erratic behavior of addFileAttachmentAsync
and removeAttachmentAsync
in the Outlook New UI for Mac. If you have any further questions or concerns, please don't hesitate to reach out.