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

Null Return Value in Office.context.document.settings.get Method on PowerPoint Web Presentation Mode #3406

Closed moeBabazadeh closed 6 months ago

moeBabazadeh commented 1 year 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 PowerPoint add-in is facing a recent issue with the Office.context.document.settings.get method. It returns null uniquely in the presentation (read) mode of the web version, while operating as expected in the edit mode of the web version and in both modes on the desktop version. The add-in, published and functional for nearly a year, predominantly caters to desktop users, which makes the exact timeline of this problem's emergence unclear.

P.S. It's important to mention that Office.context.document.settings.refreshAsync is consistently invoked before Office.context.document.settings.get, and it consistently returns successful results.

Your Environment

Expected behavior

Our expectation is for consistent cross-platform performance of the Office.context.document.settings.get method. It should return identical data irrespective of the platform (desktop or web) or the current view of the PowerPoint presentation (edit or presentation mode).

Current behavior

Contrary to the expected behavior, the Office.context.document.settings.get method in our PowerPoint add-in is showing inconsistency. It correctly returns data in the edit mode of the web version and in both modes on the desktop version. However, it returns null specifically in the presentation (read) mode of the web version. This inconsistency is resulting in an uneven user experience across different platforms and modes and inhibiting us from delivering the functionality we aim for, as we are unable to fetch the correct data saved in the add-in instance.

Steps to reproduce

  1. Save the add-in settings using the command Office.context.document.settings.set("__ACTIVECLASS_ADDIN_SETTINGS", addinSettings);where addinSettings is a JavaScript object containing several string key-values.
  2. Persist the data by calling Office.context.document.settings.saveAsync.
  3. Refresh the content or task pane add-in's copy of those settings held in memory by calling Office.context.document.settings.refreshAsync.
  4. Attempt to retrieve the data using Office.context.document.settings.get("__ACTIVECLASS_ADDIN_SETTINGS");.

Observe the issue when executing these steps in the presentation (read) mode of the web version of PowerPoint.

Context

This issue is currently a significant impediment requiring immediate resolution. Our add-in, reliably operational for nearly a year, is now affected, disrupting our users' experience. As the add-in functionality heavily relies on reading settings in presentation mode, your swift assistance to resolve this problem is crucial and highly appreciated.

Useful logs

For further clarity, please find attached two screenshots demonstrating the issue:

The first screenshot displays the console log showcasing the retrieved add-in settings in the edit mode.
The second screenshot represents a similar console log but in the presentation mode, where the issue is prominent.

Screenshot_20230607_170730 Screenshot_20230607_170957

xuruiyao-msft commented 1 year ago

@admir4l Thanks for reporting this issue. The work item(8031395) is created to track it. If there's any further progress, we'll sync with you. Thanks again.

moeBabazadeh commented 6 months ago

This is still not working on Web Office and read mode!