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
687 stars 94 forks source link

Certain EML attachments produce GenericResponseError (9020) response from Office.context.mailbox.item.getAsFileAsync #4923

Closed lunarwtr closed 3 weeks ago

lunarwtr commented 1 month ago

Provide required information needed to triage your issue

When I attach certain EML files as attachments to a new Outlook mail.

image

When I try to later use the

    Office.context.mailbox.item.getAsFileAsync({}, (result) => {
      if (result.status === Office.AsyncResultStatus.Succeeded) {
        // ...
      } else {
        console.error(result.error); // ... <---- Will cause error here
      }
    });

I alway get the error condition

{
    "name": "GenericResponseError",
    "message": "An internal error has occurred.",
    "code": 9020
}

Your Environment

Expected behavior

Success of the getAsFileAsync call. Our Addin is trying to fetch the EML for mailbox item.

Current behavior

9020 GenericResponseError from officejs api

Steps to reproduce

As mention above

  1. I've attached a Red Robin promotion email that seems to cause the problem for me. I've attached it to the ticket as a ZIP file since ticket wouldn't let me attach an EML file type.
  2. Create a new email with the test EML as an attachment and send it to yourself (or have someone send it to you).
  3. Perform the getAsFileAsync on mailbox item test.zip
Swathy-Mothilal commented 1 month ago

Thanks @lunarwtr for reporting this issue. It arises when the EML attachments contain characters outside the Latin1 range.

It has been put in our backlog and unfortunately, we don't have timelines to share at this point. Internal tracking id: Office: 4941750

whoanuragverma commented 3 weeks ago

This issue has been fixed and should be available in build 20241014069 or later. Thank you for raising the issue and helping us make the product better.