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

Calling the getAttachmentContentAsync method freezes Outlook add-ins #912

Closed clavx closed 3 years ago

clavx commented 4 years ago

If we attach an Outlook item to a mail, call the getAttachmentsAsync method to obtain an ID, and then call the getAttachmentContentAsync method using that ID, you will get no exceptions, just a freeze.

Expected Behavior

The process does not freeze and the contents of the attached item can be obtained.

Current Behavior

We can't do anything because the process is frozen.

Steps to Reproduce, or Live Example

  1. Open Outlook for Windows
  2. Click the "New Mail" button to create a new mail
  3. Adds a single multibyte character to the mail text. You do not need to enter the address or subject. For example, enter a Japanese character "あ" in the mail text. When you copy and paste multibyte characters from a website, select "Keep Text Only" in Paste options.
  4. You can save the mail. Contribute creates the mail in your draft.
  5. Create another new mail
  6. Click the "Outlook item" button, select the mail that was saved in the draft you just created, and check "Insert as Attachment" to attach it.
  7. Run the following code
  const item = Office.context.mailbox.item;
  item.getAttachmentsAsync((result) => {
    console.log(result);
    for (let i = 0; i < result.value.length; i++) {
      item.getAttachmentContentAsync(result.value[i].id, (result2) => {
        console.log(result2);
      });
    }
  });

I reinstalled Office 365 ProPlus based on the following site, but there was no change. Uninstall Office from a PC - Office Support

Your Environment

Reezaali commented 4 years ago

@clavx sorry to hear that you've run into this issue.

@exextoc can you investigate please? Thanks.

exextoc commented 4 years ago

I've tried this scenario. and what I repro is that the callback for getAttachmentContentAsync is never called. Is this what you mean by "frozen"? Or does the actual Outlook Process Crash?

clavx commented 4 years ago

It means that getAttachmentContentAsync is never return. The Outlook process does not crash.

exextoc commented 4 years ago

Thanks, as mentioned, we can repro the bug. I have added this bug to the product team's backlog, but I cannot comment on when or if the bug will be fixed.

exextoc commented 4 years ago

Internal tracking id: Office:3857410

Matej4386 commented 3 years ago

Any news?

Diegoescalonaro commented 3 years ago

Any news on this? getAttachmentContentAsync is not working

exextoc commented 3 years ago

There were some issues while fixing this that the product team is taking another look at. I don't have further updates to share at this time.

Internal Tracking Id changed to: Office: 4720588

clavx commented 3 years ago

@exextoc I was unable to reproduce the issue with the steps I reported. I think this issue has been resolved, do you have any updates?

Tested:

exextoc commented 3 years ago

We cannot reproduce this issue as well using the steps you provided above. We will look into this issue again if it ever resurfaces.