Hi,
I am playing with service worker to make application run offline.
SmartClient version is 11.1 - 2018-12-25.
I am detecting failed calls to RestDataSource endpoint in a service worker and, if the call failed because the client got offline, I am returning: {response: { status: 1 }}.
Without that I am getting dsResponse with status == -90 (transport error) instead of 1 (offline).
The problem is with the following scenario:
1. I am online
2. I fetch data to databound ListGrid from RestDataSource.
3. I go offline (by disconnecting Wifi)
4. I call ListGrid.refreshData
5. I return {response: { status: 1 }} from service worker
6. ListGrid's contents are replaced with ListGrid.emptyMessage
Expected result for point 6 is to see ListGrid.offlineMessage.
It works as expected if I call fetchData in point 4.
I have just checked that if call refreshData on ListGrid that is already showing offlineMessage it is replaced by emptyMessage while offline.
Also please take a look should I be getting dsResponse with status == 1 (offline) directly from SmartClient instead of status == -90 (transport error) when there is problem with connection without using service worker.
Best regards,
Janusz
I am playing with service worker to make application run offline.
SmartClient version is 11.1 - 2018-12-25.
I am detecting failed calls to RestDataSource endpoint in a service worker and, if the call failed because the client got offline, I am returning: {response: { status: 1 }}.
Without that I am getting dsResponse with status == -90 (transport error) instead of 1 (offline).
The problem is with the following scenario:
1. I am online
2. I fetch data to databound ListGrid from RestDataSource.
3. I go offline (by disconnecting Wifi)
4. I call ListGrid.refreshData
5. I return {response: { status: 1 }} from service worker
6. ListGrid's contents are replaced with ListGrid.emptyMessage
Expected result for point 6 is to see ListGrid.offlineMessage.
It works as expected if I call fetchData in point 4.
I have just checked that if call refreshData on ListGrid that is already showing offlineMessage it is replaced by emptyMessage while offline.
Also please take a look should I be getting dsResponse with status == 1 (offline) directly from SmartClient instead of status == -90 (transport error) when there is problem with connection without using service worker.
Best regards,
Janusz
Comment