Skip to content

Fix invalid polygon state issues#7060

Merged
grzesiek2010 merged 5 commits intogetodk:masterfrom
seadowg:fix-invalid
Jan 30, 2026
Merged

Fix invalid polygon state issues#7060
grzesiek2010 merged 5 commits intogetodk:masterfrom
seadowg:fix-invalid

Conversation

@seadowg
Copy link
Member

@seadowg seadowg commented Jan 30, 2026

Closes #7055
Closes #7054
Closes #7057
Closes #7056

This fixes issues with invalid polygon points not updating on the map properly.

Why is this the best possible solution? Were any other approaches considered?

Comments inline.

How does this change affect users? Describe intentional changes to behavior and behavior that could have accidentally been affected by code changes. In other words, what are the regression risks?

These changes do not touch the map engines so test with one is fine. It does however end up making some changes that affect other areas of the app:

  • Managing offline map layers
  • Audio recording
  • Deleting blank and saved forms

Before submitting this PR, please make sure you have:

  • added or modified tests for any new or changed behavior
  • run ./gradlew connectedAndroidTest (or ./gradlew testLab) and confirmed all checks still pass
  • added a comment above any new strings describing it for translators
  • added any new strings with date formatting to DateFormatsTest
  • verified that any code or assets from external sources are properly credited in comments and/or in the about file.
  • verified that any new UI elements use theme colors. UI Components Style guidelines

@seadowg seadowg changed the title Fix invalid polygon issues Fix invalid polygon state issues Jan 30, 2026
object LiveDataExt {
fun <T, U> LiveData<T>.zip(other: LiveData<U>): LiveData<Pair<T, U>> {
return LiveDataUtils.zip(this, other)
fun <T, U> LiveData<T>.combine(other: LiveData<U>): LiveData<Pair<T, U>> {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Calling this zip was misleading as it behaves like combine and that mismatch was what ended up causing the problems in #7055.

}

updateUi()
setChangeResult()
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was causing an infinite loop! I couldn't work out how to reproduce with the threading setup in tests.

@grzesiek2010 grzesiek2010 merged commit dbb8dfc into getodk:master Jan 30, 2026
7 checks passed
@WKobus
Copy link

WKobus commented Feb 3, 2026

Tested with success

Verified on Android 16

Verified cases:

-Listed issues no longer occur

  1. Saved points are not visible in the map until new one is added #7055
  2. Flickering points in a geoshape/geotrace with incremental=true #7054
  3. Not possible to move a point in geoshape/geotrace with incremental = true #7057
  4. Crash after saving a trace or a shape in a question with incremental=true in OSM #7056
  • Different map sources
  • Regression check on audio widget
  • Deleting saved and blank forms
  • Regression check on maps

@srujner
Copy link

srujner commented Feb 3, 2026

Tested with success

Verified on Android 14

@dbemke
Copy link

dbemke commented Feb 3, 2026

Tested with success

Verified on Android 10

@seadowg seadowg deleted the fix-invalid branch February 3, 2026 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

5 participants