Skip to content

Protect points list by returning a defensive copy#7042

Merged
seadowg merged 1 commit intogetodk:masterfrom
grzesiek2010:COLLECT-7040
Jan 21, 2026
Merged

Protect points list by returning a defensive copy#7042
seadowg merged 1 commit intogetodk:masterfrom
grzesiek2010:COLLECT-7040

Conversation

@grzesiek2010
Copy link
Member

@grzesiek2010 grzesiek2010 commented Jan 21, 2026

Closes #7040
Closes #7011

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

Mapbox poly features used to return the original points, so the scenario was as follows:

  1. A user added x points.
  2. The user moved one of the points.
  3. We read the updated list of points from the map fragment to update the ViewModel.
  4. Before updating the ViewModel, the poly features were disposed, which cleared the points and also emptied the list we had just read in step 3.

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?

It should simply fix the issue. Nothing else should be affected.

Do we need any specific form for testing your changes? If so, please attach one.

Forms can be found in the issues.

Does this change require updates to documentation? If so, please file an issue here and include the link below.

No.

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

@grzesiek2010 grzesiek2010 marked this pull request as ready for review January 21, 2026 13:36
@grzesiek2010 grzesiek2010 requested a review from seadowg January 21, 2026 13:36
@seadowg seadowg merged commit 1734411 into getodk:master Jan 21, 2026
7 checks passed
@WKobus
Copy link

WKobus commented Jan 23, 2026

@dbemke
Copy link

dbemke commented Jan 23, 2026

Tested with success

Verified on device with Android 10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

4 participants