Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix disappearing entity lists #6269

Merged
merged 3 commits into from
Jul 17, 2024
Merged

Conversation

seadowg
Copy link
Member

@seadowg seadowg commented Jul 16, 2024

Closes #6262
Closes #6163
Closes #6160

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

The solution itself is a little hacky, but the current entities storage implementation (JsonFileEntitiesRepository) is about to go away, and the most important thing here in my opinion is to get a test in to verify correct behaviour in the new implementation.

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?

Checking entity forms/projects here is probably the most important thing.

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

@@ -57,7 +57,7 @@ abstract class EntitiesRepositoryTest {
}

@Test
fun `#save updates existing entity with matching id in different list`() {
fun `#save creates entity with matching id in different list`() {
Copy link
Member Author

@seadowg seadowg Jul 16, 2024

Choose a reason for hiding this comment

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

This behaviour isn't something we have an opinion as far as I'm aware - we don't expect this to happen in real life, and if it did either behaviour feels reasonable.

@seadowg seadowg marked this pull request as ready for review July 16, 2024 13:32
@grzesiek2010 grzesiek2010 merged commit b1142cd into getodk:master Jul 17, 2024
6 checks passed
@seadowg seadowg deleted the entity-list-save branch July 17, 2024 09:06
@WKobus
Copy link

WKobus commented Jul 18, 2024

Tested with Success!

Verified on devices with Android: 10, 14

Verified Cases:

  • Registration / update forms
  • Offline entities
  • Multiple entity lists in one project

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