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

Add-in disappears from Word when switching accounts and restarting Word #1791

Closed NickDarvey closed 4 months ago

NickDarvey commented 3 years ago

Message from office-js bot: We’re closing this issue because it has been inactive for a long time. We’re doing this to keep the issues list manageable and useful for everyone. If this issue is still relevant for you, please create a new issue. Thank you for your understanding and continued feedback.

Our customers have captured an issue where our add-in disappears when they switch their account in Word and restart it.

Steps to Reproduce, or Live Example

Steps Recording from an affected computer.

Prerequisites:

  1. Install add-in from AppSource using M365 account, opening Word
  2. Switch to local account. (The add-in disappears.)
  3. Switch to M365 account. (The add-in reappears.)
  4. Switch to local account. (The add-in disappears.)
  5. Close Word
  6. Open Word, signed in to local account. (No add-in.)
  7. Switch to M365 account

Expected Behavior

The add-in reappears.

Current Behavior

The add-in does not reappear, and has to be reinstalled per step 1 of the repro.

Context

Your Environment

NickDarvey commented 3 years ago

And can anyone tell me where I should be raising an 'official' support request for this issue? Partners Center? Here?

lindalu-MSFT commented 3 years ago

@NickDarvey I've triaged this and assigned a few of our PMs in the Word Add-ins team. You can also try Microsoft Q+A and tag https://docs.microsoft.com/en-us/answers/topics/office-js-dev.html office-js-dev.

AbidRahman-MSFT commented 3 years ago

Hey @NickDarvey,

Thank you for reporting the issue. This is unfortunately expected behavior with our current platform. The add-in framework is only loaded on instances of the document where we have confidence that it will be utilized (for e.g. if an add-in was previously installed by that account). As you've observed, this will only occur if a new document is opened while the user is signed into an account that does not have any add-ins installed.

The current workaround is to sign in to the account that has add-ins installed, and re-start Word if the add-in was acquired through Centralized Deployment. Opening a new document while logged into that account will boot the add-in framework. You can also try this for add-ins acquired through the Store, but you may ultimately need to re-install the add-in.

How common is this scenario for your users? Are you finding that a lot of users switch back and forth between the identities when they are using add-in or Word in general?

In the meantime, we will add this issue to our backlog and continue to discuss what an appropriate fix should be.

Thanks, Abid

NickDarvey commented 3 years ago

The current workaround is to sign in to the account that has add-ins installed, and re-start Word if the add-in was acquired through Centralized Deployment. Opening a new document while logged into that account will boot the add-in framework.

This would be an acceptable workaround. Is local storage retained through this? (If our add-in stores things in local storage, will it be lost each time this happens?)

You can also try this for add-ins acquired through the Store, but you may ultimately need to re-install the add-in.

A better workaround for this scenario would be appreciated as we keep running into issues with centralized deployment. (e.g. not all customers have the right licenses for it; it doesn't work with external identities, such as GoDaddy-managed Office 365.)

Given the way the add-in framework is loaded, would another workaround be to install any other add-in under the local account ('CN' in the steps recording)?

How common is this scenario for your users? Are you finding that a lot of users switch back and forth between the identities when they are using add-in or Word in general?

We're in early access preview, but two of our six first batch of users encountered this. Switching accounts is common for them. We have also encountered this internally with our team. Switching accounts is common for us as some of us work across multiple businesses.

AbidRahman-MSFT commented 3 years ago

We've added backlog item (#5039675 for internal tracking) to address this issue.

Thank you for providing the information here @NickDarvey. To answer your first question, local storage should be retained through this (but sessionStorage will not). It should be no different than if you visited a webpage, closed your browser, and then re-opened that same web page at a later time.