Introduce functions in OpenlmisCachedResource that fetch data both online and offline


In OpenlmisCachedResource we should have functions that allow us to fetch the data no matter if we are online or offline. The functions should discover if we are online or offline.

If we are online, it fetches the data from the remote resource (server) with If-Modified-Since param. If there are changes it updates them in the cache. Then we return the resource from the cache.
If we are offline, it attempts to fetch the data from the cache.


Joanna Szymańska
January 25, 2021, 6:16 PM

The above error no longer occurs.

Joanna Szymańska
January 22, 2021, 2:53 PM

Thank you for the explanation! I thought you have to go to the right screen every time to load the data

Paulina Buzderewicz
January 22, 2021, 2:51 PM

According to the 2nd issue - after opening Adjustment in online mode, all the necessary data (both for Adjustments and Issue) was cached, therefore we can enter Issue in offline mode.

Joanna Szymańska
January 22, 2021, 2:23 PM

  1. Now internal error only shows up for EM and only the first time. If I wait a while and click the "Make Adjustment" or "Make Issue" button, the correct error is already visible as with FP.

Reproduction steps:

  1. Clear the cache.

  1. Log in to the application.

  1. Go Offline.

  1. Go to Stock Management> Issue / Adjustment.

  1. Click "Make Adjustment" / "Make Issue" button.

  1. Internal error appears.

  1. Try to click the button again after some time or after returning from another tab.

  1. The information takes longer to load, but it is already correct.

2. I also noticed that when I go online only to Adjustment (or only to Issue) and then go offline, Issue also opens.

Reproduction steps:

  1. Clear the cache and log in to the application.

  2. Go to Stock Management> Adjustment.

  3. Click e.g. "Make Adjustment" for FP.

  4. Go offline and go to Stock Management> Issue.

  5. Click the "Make Issue" button.

  6. Issue is also opening.

  7. I haven't loaded data for Issue before, so an error should appear.

Klaudia Pałkowska
January 22, 2021, 1:29 PM

Could you check it again? Now it should work properly.

Your pinned fields
Click on the next to a field label to start pinning.


Paulina Buzderewicz


Sebastian Brudziński