Open jo-spek opened 2 months ago
So I just figured this happens the further I am away from the "center of action", i.e. where most mapping takes place. I was on the survey that takes place in Ghana but was testing it in Germany where the app just wouldn't work.
Faking my GPS to be close to Kumasi, the survey worked just fine, but coming closer to the Côte d'Ivoire border the misbehavior started again.
I verified that this is happening when new sites (LOI) are received from the server. Two primary issues to investigate:
@shobhitagarwal1612 you were looking into the viewport, do you have any observations to add here?
I'm not sure why that is happening. Will try repro'ing it locally to understand what's happening under the hood
I'm not sure why that is happening. Will try repro'ing it locally to understand what's happening under the hood
Sounds good. Be sure to try with dev Firebase and not local emu, since Cloud Messaging isn't supported there.
Initial debugging reveals that GoogleMapsFragment.setFeatures()
is called 5 times when an LOI is modified in the remote datastore:
2024-11-11 16:17:54.337 3951-3951 GoogleMapsFragment com.google.android.ground V setFeatures() called with 5 features
2024-11-11 16:17:54.712 3951-3951 GoogleMapsFragment com.google.android.ground V setFeatures() called with 5 features
2024-11-11 16:17:54.720 3951-3951 GoogleMapsFragment com.google.android.ground V setFeatures() called with 5 features
2024-11-11 16:17:54.726 3951-3951 GoogleMapsFragment com.google.android.ground V setFeatures() called with 6 features
2024-11-11 16:17:54.732 3951-3951 GoogleMapsFragment com.google.android.ground V setFeatures() called with 6 features
While SurveyRepository.loadAndSyncSurveyWithRemote
is called only once as expected. We may need to debounce or otherwise isolate changes to the local db to prevent the UI from getting thrashed.
Just verified that this isn't occurring in the latest codebase. @jo-spek can you please re-open if this occurs again?
I just observed this again at HEAD right after new LOIs were synced. It appears that as the UI catches up with newly synced remote changes the map gets forced back to the previous viewport. Probably related to #2831.
Relating partially to issue https://github.com/google/ground-android/issues/2727:
On my personal Android Device (Xiaomi Poco X3 NFC, Android 12 SKQ1.211019.001, GROUND build 0.1.9-openforis) in this survey, the map is randomly locked to the most recent place. Only when moving away and holding my finger on the touchscreen a little longer does the map move along and not jump back to the previous place. However, then the new place is sort of "ghost-locked". This makes sliding the map around for geolocation almost impossible. All the while, the "Add data collection site" card does randomly appear and disappear. See the video for better understanding.
The same did not happen on any other of my surveys, however, some of the 'smoothness' of gliding over the map is gone and there are frequent small 'jumpbacks' (for lack of a better word). They are only annoying and do not inhibit the work, but diminish the user experience.
https://github.com/user-attachments/assets/c6231977-8d52-4e56-8f1c-d0a1d18d895f