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

Preview Launch-Based Activation troubleshooting #1861

Closed barclayadam closed 2 years ago

barclayadam commented 3 years ago

I am trying to use the preview of event-based activation (https://docs.microsoft.com/en-us/office/dev/add-ins/outlook/autolaunch) but it is proving to be a massively frustrating experience.

I did have it working, I think, at one point using v16.0.14026.20138 of Outlook 365 but I simply cannot get it working again. I have stripped code back to an almost bare minimum to just add a notification message to ensure it's not the code itself, but nothing seems to work. Have tried following the setup instructions and used the yeoman generated solution but that fails too.

The same add-in declares a task pane and that loads absolutely fine. Also, see the event-based activation working absolutely fine in OWA (OnNewMessageCompose).

Expected Behavior

Event-based activation to a) work or b) give an actionable error message

Current Behavior

Two scenarios seem to happen, but I have no idea what triggers one vs the other:

  1. Absolutely nothing happens. No errors
  2. "We're sorry, we couldn't access [add-in name]. Make sure you have a network connection. If the problem continues, please try again later"

The second error seems ideal as it point to soemthing not being right. I cannot find anywhere where this issue would actually be logged though. I tried using the runtime logging, but that is pretty sparse of details, the only thing that seems half-related is:

12/05/2021 16:57:24 Verbose Runtime [Console] [Log] Platform Bundle - Office exists!        
12/05/2021 16:57:24 Verbose Runtime [Console] [Log] Platform Bundle - Office.actions exists!        
12/05/2021 16:57:24 Verbose Runtime [Console] [Log] Platform Bundle - Office.actions.associate exists!      
12/05/2021 16:57:24 Verbose Runtime [Console] [Log] Outlook Batch JS loaded!        
12/05/2021 16:57:24 Verbose Runtime [Console] [Log] Outlook LaunchEvent JS loaded!

I did once see a message related to running the function I had declared, but unfortunately, I do not have that line to hand and cannot reproduce. That appeared to happen whilst I was not looking (i.e. I opened compose window and nothing happened, but when coming back to it later it had run the command)

Steps to Reproduce, or Live Example

I can replicate on multiple machines using our deployed add-in, but would prefer to not share link publically.

Note that this is happening with a hosted add-in, added via. it's manifest URL, and is therefore NOT a localhost problem.

Your Environment

Below is our current manifest with text removed and link addresses changed. I can confirm all of those URLs can be loaded.

Anonymised Manifest - 1.2.0.0 - en-US
ReadWriteItem false