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

Office Settings API not persisting settings in PowerPoint Online after closing the add-in or reloading the web page. #2704

Open jgonzalez-at-wiris opened 2 years ago

jgonzalez-at-wiris commented 2 years ago

Office Settings API not persisting settings in PowerPoint Online after closing the add-in or reloading the web page.

Your Environment

Expected behavior

I expect all saved data using the Settings API to be available after reopening the add-in or after reloading Office Online webpage.

Current behavior

When I save data using the Settings API, it is available as long as I don't close the add-in. But as soon as I close the add-in taskpane or reload the web page, all saved settings are lost.

Steps to reproduce

  1. Open an add-in (you'll find a gist in the next section) that saves data using the Settings API. Add a setting name and value using the first two inputs. For example: "country" as setting name, "Canada" as setting value.
  2. Fetch the saved data, using the third input, check that everything is OK (i.e. if you use "country" as setting name, "Canada" should display as value)
  3. Close your add-in, open it back. Alternatively, reload the web page.
  4. Fetch the saved data, repeat step 2. Check that the setting couldn'd be found. (i.e. if you use "country" as setting name, no value is shown)

Link to live example(s)

Here you can find a gist you can use to follow the previous steps: https://gist.github.com/jgonzalez-at-wiris/e94c50d94f16630ddac2a3c3eabb9e78

Provide additional details

This seems to happen under specific circumnstances, for example, I can reproduce it using Brave, but not using Chrome, but some coworkers of mine can reproduce it with Chrome as well (and with Safari in macOS). Additionally, this happens with PowerPoint but not using Word. In desktop environement, everything works fine in both cases (Word, PPT).

Context

We need to store some data regarding the document being edited. We need that data to be available across different platforms (desktop, online, iPad, etc). Settings API is the best available solution for us.

Useful logs

There's nothing extra I can share: console shows no errors related to this problem, and it happens no matter the document used.

xuruiyao-msft commented 2 years ago

@jgonzalez-at-wiris I tried to reproduce the issue but failed. I want to confirm which situation you are in: 1, Settings are saved in the online ppt doc but you cannot get the settings value from desktop platform. 2, or Settings are save in the online ppt doc but your coworkers cannot get the settings value from online or from desktop platform. Which situation is more similar to yours?

jgonzalez-at-wiris commented 2 years ago

Hello @ahegongzhu.

The situation is:

  1. in PowerPoint online, saved settings are lost if you relaod the webpage (this is not the expected behaviour).
  2. if you save settings in PowerPoint online, download the file, and then open it with PowerPoint desktop, the settings are available (this is the expected behaviour)

My coworkers simply can't reproduce the problem with the same browser as I do: in my case I can't reproduce this issue with Chrome, but they do.

xuruiyao-msft commented 2 years ago

@jgonzalez-at-wiris Thanks for clarification. I've created the work item 6370702 to track the issue. And If there's any update, I will synch with you.

theboyknowsclass commented 1 year ago

we are having a similar issue, it seems the saveAsync method is throwing a 5001 error can someone advise?

Augustalex commented 1 year ago

Having the same issue with the save function throwing a 5001 error. Any news on this?

xuruiyao-msft commented 1 year ago

@theboyknowsclass @Augustalex Thanks for reporting your issue. Would you please open another item to track the saveAsync related error? You could provide more details to help us reproduce the case. It's better to track different problem on separate thread. Thanks again for reaching out to us.

xuruiyao-msft commented 1 year ago

@jgonzalez-at-wiris it cannot be reproduced from Chrome/Brave browser on my local env before and now. From the "additional details" part, the issue happens randomly or under specific circumstances. If you could figure out under what circumstances the issues must occur, it would help us decide the next step. Thanks again for reporting it to us.

duckypham112 commented 1 month ago

@xuruiyao-msft
is there any update on this issue ?