Open MrCsabaToth opened 4 years ago
The situation might not be as bad as I thought. Apparently Firebase library layer could be smart enough to not actually transfer all the data all the time, but to grab what it already has from the local cache. So possibly it is only presented to the ViewModel / Repository layer as a complete list all the time, but on the wire only the differential data is transferred.
See https://github.com/DIYGPSTracker/DIYGPSManager/commit/af7d0f5b87bc13a705efe7c6c487e57e93de8c51
The observer on the LiveData seems to supply the whole series (from the point of lookback) every single time. I added extra logic to skip that over and don't overload the UI with redundant pins, but I should figure out a way to also not get that much data the first place, because this won't scale. Maybe we can re-query based on the timestamp of the latest received pin or something.