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

Quickly sending an email closes the dialog opened by displayDialogAsync() #5026

Open mailchecktool-admin opened 6 days ago

mailchecktool-admin commented 6 days ago

Your Environment

Summary

We are reporting an issue with an Office add-in that uses ItemSend events. This add-in executes the ItemSend event and displays a dialog each time an email is sent. After the first email is sent in Outlook, if a second email is sent quickly, the dialog that was opened when the second email was sent is forced to close. Is it due to the add-in's specification that the dialog opened by displayDialogAsync() is closed when the email is sent repeatedly?

Steps to reproduce

  1. Upload “manifest.xml” to Outlook on 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 the add-in from Extensions.
  7. Create a new email and click the “Send” button. *It is no problem to send a draft e-mail.
  8. The Office add-in will be launched and the sample screen will be displayed.
  9. Click “close(true)” in the dialog to send the e-mail.
  10. Continue to compose the e-mail and then quickly send it. It is no problem to send a draft e-mail. Sending must be done quickly within about 2~3 seconds.
  11. The Office add-in will start and the sample screen will be displayed, but it will be closed immediately.

Sample add-ins are saved. Sample add-in program https://github.com/mailchecktool-admin/Office-addin-sample/tree/main

mailchecktool-admin commented 21 hours ago

@exextoc Any progress on this matter?

mmanjaree-msft commented 14 hours ago

Could you share a video of the issue, meanwhile trying out the scenario with addin shared above. The scenario seems to work fine with some other addin. just to be clear, here we need ot send two emails and for second one dialog closes immediately without any user interaction?

mailchecktool-admin commented 4 hours ago

@mmanjaree-msft I created the video in question using the sample provided.Please check it out. here we need ot send two emails and for second one dialog closes immediately without any user interaction? ▷Yes, two emails need to be sent and the dialog opened when the second email is sent is immediately closed. レコーディング-20241106_113257.zip