Skip to Content
0
Apr 21, 2021 at 09:30 PM

MDK: Enhance OfflineStore DataModel in running app

275 Views

Hi,

my problem: is it possible in MDK / AssetManager to add a field to an object, once the app is running? I have added all fields, updated all methods and tests in GW_CLIENT are running fine. But the app is already installed, the field is not part of the offline store and the user has created entries for that entity.

Whenever I try to do this, the upload of data to backend fails with an error on the device. This happens after the data is successfully created in the backend, so sending data from device to backend is fine, even without the new field. Just the response causes an exception on the device cause it contains the new field and the client does not know how to handle this data - even I send it as an empty field.

[-100024] An error occurred while retrieving or parsing the response for request "<objectname>".\n Error caused by: Illegal argument for method call with message '<new fieldname>'.)\n at Function.ODataServiceProvider.toJSError

I can fix this with a new initial load -but then I will loose all data on the device that needs to be uploaded after that error. A new sync starts from scratch, so even this is not solution.

Unfortunately even it is an error on the device, the sync protocol is fine - and even the log in the mobile service is only a warning. Only the text itself shows that it is seen as an error:

2021-04-21 22:43:06.933WarningWarnung liegt vor <registration ID of device>Offline

<369944> [-10225] Error caused by: Illegal argument for method call with message '<fieldname>'.

So this problem is not shown in the support screen as sync error on the device and I am not able to remove this entry from the device and continue next sync without that item.

Any solution?