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
671 stars 95 forks source link

Outlook on the web has different values for attachments that can be retrieved with getAttachmentsAsync in certain situations. #4642

Closed mailchecktool-admin closed 2 months ago

mailchecktool-admin commented 3 months ago

Provide required information needed to triage your issue

Your Environment

Summary

In Outlook on the web, if I insert an image into the body of an email, I can get the attachment with getAttachmentsAsync, but once I save it as a draft and then get it, it is not recognized as an attachment item. Does a specific action change the format of attachments in the body of the email?

Current behavior

  1. Insert images within the body of an email in Outlook on the web.
  2. Save as a draft.
  3. Reloading.
  4. Send the email you just saved from the draft. At this time, if you check the value of the attachment retrieved by getAttachmentsAsync, you will find that the attachment cannot be retrieved.
mailchecktool-admin commented 3 months ago

I checked the value obtained by getAttachmentsAsync in the console, and it shows that the value is not included if it was sent from a draft.

【When first composing an email】 スクリーンショット 2024-07-04 134443 ↓ 【After performing the above operation】 スクリーンショット 2024-07-04 134356

Swathy-Mothilal commented 3 months ago

@mailchecktool-admin could you please share a repro video and the manifest where you are encountering the issue? Additionally, just to clarify, are you using getAttachmentAsync only in the MessageCompose context as specified in the documentation at https://learn.microsoft.com/en-us/javascript/api/outlook/office.messagecompose?view=outlook-js-preview&preserve-view=true#outlook-office-messagecompose-getattachmentsasync-member(1)

Swathy-Mothilal commented 3 months ago

@mailchecktool-admin We noticed another GitHub post created at https://github.com/OfficeDev/office-js/issues/4643 regarding the same issue on a different platform by you. Could you please summarize on which platforms are experiencing this issue?

mailchecktool-admin commented 3 months ago

@Swathy-Mothilal This event is reproduced in Outlook on the web(chrome). Although #4643 refers to the event in the Outlook client, the question is the same.

The question is : does the size, name, and retrieved value of an image inserted in the body of an email change when the drafts folder is moved or reloaded? I have taken a screen recording of the event and am attaching it herewith. The add-in I am developing starts when the mail is sent, It is retrieved by getAttachmentsAsync from the contents of Office.context.mailbox.item. The image that is checked in console.log is the image inserted in the body of the email. When sending after reloading, the attachment file obtained by getAttachmentsAsync is empty even if the add-in is started.

Has a similar problem been reported elsewhere?

ビデオ 7-04 18.15.zip

Swathy-Mothilal commented 3 months ago

@mailchecktool-admin In Outlook on the web the attachment identifier is valid only within the same session. A session is over when the user closes the app. For more info, please refer to https://learn.microsoft.com/en-us/javascript/api/outlook/office.messagecompose?view=outlook-js-preview#outlook-office-messagecompose-getattachmentcontentasync-member(1).

mailchecktool-admin commented 2 months ago

@Swathy-Mothilal Sorry for the late reply. I have read the documentation and understand the getAttachmentAsync specification. However, I believe that users often close or pop out of the application, so if possible, I would like you to revise the specification so that getAttachmentAsync is enabled even outside of the same session. Thank you in advance.

rkpathak commented 2 months ago

Currently we dont support this. We track Outlook add-in feature requests on our Tech Community Page. Please submit your request there and choose the appropriate label(s). Feature requests on Tech Community are considered, when we go through our planning process.

Github Label: “Type: product feature request” https://aka.ms/M365dev-suggestions

microsoft-github-policy-service[bot] commented 2 months 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!

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

This issue has been closed due to inactivity. Please comment if you still need assistance and we'll re-open the issue.