google / google/ground-android
[Code Health] Map features and card flicker on remote changes
- Dominant language
- Kotlin
- Stars
- 293
- Forks
- 149
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 42
Description
Also:
> 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.
_Originally posted by @gino-m in [#2728](https://github.com/google/ground-android/issues/2728#issuecomment-2469041066)_
Contributor guide
Assessment
This issue has not been assessed yet.