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

Behavior of getAttachmentsAsync to get msg file is different between OWA and desktop version. #4550

Open mailchecktool-admin opened 1 month ago

mailchecktool-admin commented 1 month ago

Provide required information needed to triage your issue

Your Environment

Summary

When retrieving a msg file with getAttachmentsAsync, the size is displayed on OWA, but on the client it is displayed as 0 (the capacity cannot be retrieved).

Current behavior

1.Open outlook on the web. 2.Install add-ins from Extensions. 3.Specify the recipients, specify msg files as attachments, and click the “Send” button. 4.The Office add-in will start and a sample display will appear. 5.Open the Developer Tools and check the attachment information displayed in the console to see the size. 6.Launch Outlook. 7.Install the Office add-in to Outlook. 8.Specify the recipients, specify msg files as attachments, and click the “Send” button. 9.The Office add-in will start and a sample display will appear. 10.Open the developer tools, go to Applications > Local Storage and check the value of the key “MAIL_ATTACHMENT” and the size is displayed as 0.

Steps to reproduce

1.Upload "manifest.xml" to Outlook on the web and install the add-in (the XML file is stored in sample.zip) 2.Open a command prompt and navigate to the corresponding directory. 3.Run "npm install". 4.Run "npm run dev-server". 5.Open outlook on the web. 6.Install add-ins from Extensions. 7.Specify the recipients, specify msg files as attachments, and click the “Send” button. 8.The Office add-in will start and a sample display will appear. 9.Open the Developer Tools and check the attachment information displayed in the console. 10.Launch Outlook. 11.Install the Office add-in to Outlook. 12.Specify the recipients, specify msg files as attachments, and click the “Send” button. 13.The Office add-in will start and a sample display will appear. 14.Open the Developer Tools and go to Applications > Local Storage to see the value of the key “MAIL_ATTACHMENT”.

Link to live example(s)

I am storing the sample add-in.

akagarwa-msft commented 1 month ago

Please confirm if it is old Oulook or new Outlook in windows? You can check through this toggle present in Outlook desktop on right hand side top corner:

image

Also, please share the repro video as we are not able to repro the issue at our end.

mailchecktool-admin commented 1 month ago

I am using the “old Outlook”. I took a video in my local environment, check it out. レコーディング-20240607_154855.webm

mailchecktool-admin commented 1 month ago

@akagarwa-msft I have attached a reproduction video, have you checked it? I look forward to hearing back from you as soon as possible.

mailchecktool-admin commented 3 weeks ago

@akagarwa-msft @exextoc Have you had a chance to review the information I shared previously? If you're unable to replicate the issue, we can gather the necessary data and provide it to you. Please let us know the results of your investigation.

millerds commented 6 days ago

Sorry for the large delay in responding. Can you clarify what you are doing on the classic outlook rich client to view the issue? The repro says "Open the Developer Tools" . . . but since this isn't a browser the devtools aren't just a menu away.

millerds commented 6 days ago

Looking a little more closely at your code sample, I realize that you are trying to use localstorage in a launch event. In Win32 launch events run in a JS runtime and don't have browser things like localstorage whereas when you are running the add-in in OWA there are browser features available to you. This has nothing to do with the getAttachmentsAsync itself, but rather how you are trying to use it. You should look at the asyncResult object directly in the callback to do anything with the attachments.

see: https://learn.microsoft.com/en-us/javascript/api/outlook/office.appointmentcompose?view=outlook-js-preview&preserve-view=true#outlook-office-appointmentcompose-getattachmentsasync-member(1)

microsoft-github-policy-service[bot] commented 2 days ago

This issue has been automatically marked as stale because it is marked as needing author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. Thank you for your interest in Office Add-ins!