espruino / BangleApps

Bangle.js App Loader (and Apps)
https://banglejs.com/apps
MIT License
496 stars 1.17k forks source link

[interface.html] storage cache #3631

Open bobrippling opened 3 weeks ago

bobrippling commented 3 weeks ago

@gfwilliams @thyttan I'm thinking of making the file cache used in recorder (#3607) apply to all Utils.readStorage(), so that the health interface would benefit from it - users wouldn't have to wait to re-read the same data if they want to switch between a chart and a table.

I have half a PR but wanted to know, is this a change that'd be accepted?

gfwilliams commented 2 weeks ago

I'm not sure...

For instance health data updates every 10 minutes. So maybe someone downloads the current health data then does it again a few minutes later, but then it wouldn't include the newer data? Or what if some other command is sent which updates the file in the mean time, or the user is actually running the app which is updating the file?

I just wonder whether this is fixing a problem that doesn't really exist? I can 100% imagine it makes sense with recorder, but I feel for other apps maybe not so much - I don't think anyone's complained about it and it's not like many of the files are so big they take a long time to get?

I feel like maybe the possibilities for this breaking things/making the app loader unreliable might outweigh the small inconvenience of waiting? What does everyone else think?