Office-js: Roaming Settings are not updated synchronously for Outlook web add-in for OWA

Created on 2 May 2019  路  28Comments  路  Source: OfficeDev/office-js

Hi
I am working for Outlook web add-in using Office.js. The add-in is for Windows and Mac client and OWA. I have designed a setting UI for saving user data using Roaming Setting. The user data is saved in roaming settings and updated into UI immediately for Windows and Mac client. But for OWA, the updated settings are not saved into roaming settings and thus, not updated into UI.

If I have changed settings data from window and mac client, updated settings not seen at OWA.

Expected Behavior

Roaming settings should be synchronous to all plateform. Roaming settings should be updated instantly at OWA too.

Current Behavior

Roaming settings for OWA are not updated instantly and not synchronous with window and mac client too.

Steps to Reproduce, or Live Example

Link to live example:
Please add the add-in into your Outlook for Mac by side loading - Get AddIns - My AddIn - Add from URL
https://mop.infocus.net:5000/infocus-conx-outlook-addin.xml

Context

There is an inconsistent behaviour between all the Outlook platforms for our add-in. On Windows and Mac client, roaming setting is synchronous but not for OWA.

Your Environment

Platform: OWA
Host: Outlook

Outlook product bug

All 28 comments

@nehasoni3 Can you please share the code-snippet used for settings/saving/getting settings in roaming settings?

@nehasoni3 Can you please share the code-snippet used for settings/saving/getting settings in roaming settings?

Sure @exextoc .

`function setSettings(uid, settingObj) {
// Gettings roaming settings object from Office context
var settings = Office.context.roamingSettings;
settings.set(uid, settingObj);
settings.saveAsync(saveSettingsCallback);
}

// Saves all roaming settings.
function saveSettingsCallback(asyncResult) {
if (asyncResult.status == Office.AsyncResultStatus.Failed) {
// Handle the failure.
}
}`

Please suggest some way.

Can you try using the below code snippet and let us know if you are facing the same issue? I am able to see "myKey" in the console.

setSettings('myKey', 'keyValue')
function setSettings(uid, settingObj) {
// Gettings roaming settings object from Office context
var settings = Office.context.roamingSettings;
settings.set(uid, settingObj);
settings.saveAsync(saveSettingsCallback);
}

// Saves all roaming settings.
function saveSettingsCallback(asyncResult) {
if (asyncResult.status == Office.AsyncResultStatus.Failed) {
// Handle the failure.
}
else{
console.log(Office.context.roamingSettings.get('myKey'));
}
}

I'm also having issues with Roaming Settings. Sometimes it works, sometimes it does not save the data. @exextoc Any idea what's happening?

Any help?

I'm also having issues with Roaming Settings. Sometimes it works, sometimes it does not save the data. @exextoc Any idea what's happening?

Can you please provide more details to help us investigate? Can you share code snippet for set and get Roaming Settings? Also share Outlook version details.

Please suggest some way.

@nehasoni3 can you confirm if suggested solution worked for you?

Please suggest some way.

@nehasoni3 can you confirm if suggested solution worked for you?

Yes, I have tried this , I can see the settings object but that is not synchronocusly working with OWA and Outlook MAC or Outlook

@nehasoni3 Across outlook clients sync issue could be due to delay in Roaming Settings to be saved in backend and all clients syncing the updates. Have you verified after giving some time for sync to happen?

@THPubs Can you provide details of scenario where you are observing inconsistent behavior? Also let us know the outlook client and version details.

@exextoc Sorry for the delayed response. I just created a sample plugin and hosted it. The source code can be found here: https://github.com/THPubs/outlook-office-roaming-test

The manifest file of that code points to a real live version of this app. Now,

1) Try to open it in your web client, set a value to roaming settings.
2) Now open the plugin in a mobile client and see. For me, the settings are not transferred to the other client.
3) Also noticed that you have to close the window to save the roaming settings so that if I open another browser while the original one is running, I won't find the settings saved.

@THPubs

  1. Across outlook clients sync issue could be due to delay in Roaming Settings to be saved in backend and all clients syncing the updates. Give some time for sync to happen and then verify.
  2. If the task pane navigates to another page or reloads the current page, the in-memory object is reset to its initial values, even if your add-in has persisted changes. https://docs.microsoft.com/en-us/javascript/api/outlook_1_7/office.roamingsettings?view=office-js

Just tested the plugin again in mobile. Have plenty of time to sync with the other platforms but still when I load the web client the saved values are there but the mobile client still shows empty. @exextoc

@THPubs Which Mobile Client it is? Android or iOS?

@exextoc iOS

@nehasoni3 Across outlook clients sync issue could be due to delay in Roaming Settings to be saved in backend and all clients syncing the updates. Have you verified after giving some time for sync to happen?

@THPubs Can you provide details of scenario where you are observing inconsistent behavior? Also let us know the outlook client and version details.

@exextoc Yes.I have waited for long but Add-in not working as expected.

@nehasoni3 We are not able to repro this. Sync happens after wait. As per the doc here- https://docs.microsoft.com/en-us/javascript/api/outlook_1_5/office.roamingsettings?view=office-js, "The persisted changes will not be available until the task pane (or item in the case of UI-less add-ins) is closed and reopened." Have you tried this?

@exextoc I tried it. It works for the web but not for mobile.

@THPubs Roaming settings in iOS are not synced real time. Rather they are synced at app restart if it hasn't been synced in last 5 minutes.

I have the same issue, the roaming setting was set using web app from 2019-08-02 10:00am and now 2019-08-03, on iOS 12 (iphone SE), there is nothing appears in the setting:
{"_rawData$p$0":null,"_settingsData$p$0":{}}
I opened the add in on web and still see the setting value there.
I tried to uninstall and install the latest version of Outlook for IOS, also tried to remove and add account and reset account but nothing works.
Please take a look.
Thank you.

@exextoc I also closed the app and re-opened. It still didn't work.

@THPubs can you please create a separate post for iOS mobile issue, also please create a feature request here user voice for roaming settings to be updated syncronously.

+1 on iOS issue. Settings do not sync after 15 minutes or app restart. It seems to be a different bucket then desktop/mobile

Just do a test, I update some Roaming settings on iOS device, these updates appears quickly on web client when I open, but doesnot on Andoird.

@exextoc Created a new issue and a user voice request: https://officespdev.uservoice.com/forums/224641-feature-requests-and-feedback/suggestions/38312956-sync-roaming-settings-asynchronously

Everyone who need asynchronous syncing issue, please vote in UserVoice.

Please comment in the new iOS issue if you have issues with the iOS client not getting the data at all: https://github.com/OfficeDev/office-js/issues/652

@elegault @ntranvinh

We have observed a recently introduced regression in iOS. We are working on a fix. Thanks for reporting.

@THPubs , thank you. Just added comment :)

Let's use #652 to track the issue in iOS.

Reviewing this thread, it sounds like sync across other clients is working as expected.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sshukurov picture sshukurov  路  4Comments

mattblackdev picture mattblackdev  路  4Comments

binarykitchen picture binarykitchen  路  5Comments

Jarch09 picture Jarch09  路  3Comments

dgrudenic picture dgrudenic  路  4Comments