OfficeDev / office-js

A repo and NPM package for Office.js, corresponding to a copy of what gets published to the official "evergreen" Office.js CDN, at https://appsforoffice.microsoft.com/lib/1/hosted/office.js.
https://learn.microsoft.com/javascript/api/overview
Other
686 stars 95 forks source link

[Outlook][Mac] `masterCategories.getAsync()` API returns error when the side panel is pinned #1800

Closed amegan closed 7 months ago

amegan commented 3 years ago

Message from office-js bot: We’re closing this issue because it has been inactive for a long time. We’re doing this to keep the issues list manageable and useful for everyone. If this issue is still relevant for you, please create a new issue. Thank you for your understanding and continued feedback.

Office.context.mailbox.masterCategories.getAsync() returns code: 5001, "Internal Error" if I call the API with side panel pinned on Mac Outlook. If the side panel is NOT pinned, it returns the list of categories.

Expected Behavior

The API always returns the list of categories.

Current Behavior

The API returns the list of categories only if the side panel is not pinned.

Steps to Reproduce, or Live Example

Link to scriptlab: https://gist.github.com/amegan/6ae9f63650e67e027b8a4084fecbe3b2

The same script lab code returns the list of categories if the side panel is not pinned but it starts returning the error if the side panel is pinned. Once the API starts returning the error, it keeps returning the error regardless of the pinned setting. Need to reopen the side panel to make the API work again.

Context

We attach the category to the opened email with the user action but this feature only works if the side panel is not pinned. We want to provide consistent behavior.

Your Environment

Useful logs

exextoc commented 3 years ago

@amegan Are you seeing this issue in Classic Mac Outlook or New Mac Outlook UI?

amegan commented 3 years ago

@exextoc I see the issue in Classic Mac Outlook.

I tried to run the same code in New Mac Outlook and seems even worse. With or without pinned side panel setting, It always returns "Permission Denied" error.

image

exextoc commented 3 years ago

We are able to repro this issue in Classic Mac Outlook. In new Mac Outlook, this error is shown because 1.8 APIs are not available in Production yet and will be made available in May. Currently, 1.8 API set is available in Insiders Fast build. We recommend that you test the API in the latest Insiders version and let us know if the issue gets resolved.

amegan commented 3 years ago

@exextoc ah, ok. I see Office.context.requirements.isSetSupported('Mailbox', '1.8') returns false in Outlook new UI. We can gracefully fallback with that response.

We are dealing with the behavior in the classic mac outlook. It returns Office.context.requirements.isSetSupported('Mailbox', '1.8') true but masterCategories.getAsync() API fails only if the side panel is pinned. Is there anything we can do with it?

exextoc commented 3 years ago

Could you try if this works in the Insiders beta build for New UI. We will be releasing it soon in production, so if this resolves your issue that is great.

amegan commented 3 years ago

@exextoc I verified category api starts working on insider fast outlook client in New UI. Do you have a plan to fix the issue in Old UI? We can't ask users to use New UI because of https://github.com/OfficeDev/office-js/issues/1616 .

exextoc commented 3 years ago

Thank you for confirming that this works well in the New Outlook for Mac - it will be available in prod by mid May. While we have noted down the Old UI bug, old UI bugs are lower in priority and hence we may not be able to pick it up.