farmOS / field-kit

A modular, offline-first companion app to farmOS.
https://farmOS.org
GNU General Public License v3.0
59 stars 38 forks source link

Reduce loading time on startup #495

Closed jgaehring closed 2 years ago

jgaehring commented 2 years ago

Right now, the period of time while the "Getting ready..." loading screen is displayed is unnecessarily long. I was cautious while initially implementing this, since parts of data could be syncing in the background for a while, and I was worried about user interactions and changes taking place while the data was still in an incomplete state. For instance, adding an asset to a log because it appears not to be attached, only b/c that asset's data is not yet available even when the log itself is available.

jgaehring commented 2 years ago

And I forgot to note, this is not merely a user inconvenience, but a major drag on development, in cases where I make a change to underlying state that cannot be hot-reloaded, and the entire page has to reload and then wait 15-30 sec for a full sync to conclude.

Obviously, the performance of the sync could be improved, too, but that might be better to investigate in conjunction with #494.

jgaehring commented 2 years ago

Ok, I did a quick fix of this in 70f1a66, which I think should be sufficient, apart from other things to improve the syncing performance, but that should be treated separately if the issue comes up again.

The only tricky thing is that I've been using a totally fresh server since #496, so I'm not regularly testing this with large amounts of data as I was before, so this may still be something to watch out for.