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

Show parsing error when receiving empty form list #5526

Merged
merged 3 commits into from
Mar 28, 2023

Conversation

seadowg
Copy link
Member

@seadowg seadowg commented Mar 28, 2023

Fixes this crash.

What has been done to verify that this works as intended?

New tests.

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

I did look at being able to detect that there is an empty Document rather than needing to catch a RuntimeException, but it didn't seem like there was a good way to do that with kxml2. It might be worth making a contribution there to change it so that we get a specific exception, but I'm also not sure if we should be using that library at all.

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?

There's not really much we can verify here without a broken server (I don't think there's a way to get empty 200 responses back from Central or Aggregate). Best thing to verify here is downloading and updating form - there shouldn't have been any changes in behaviour.

Before submitting this PR, please make sure you have:

  • run ./gradlew checkAll and confirmed all checks still pass OR confirm CircleCI build passes and run ./gradlew connectedDebugAndroidTest locally.
  • 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 added this to the v2023.1.x milestone Mar 28, 2023
@seadowg seadowg marked this pull request as ready for review March 28, 2023 09:59
@seadowg seadowg added the high priority Should be looked at before other PRs/issues label Mar 28, 2023
@grzesiek2010 grzesiek2010 merged commit 39e7310 into getodk:master Mar 28, 2023
@seadowg seadowg deleted the empty-response branch March 30, 2023 08:31
@seadowg seadowg removed this from the v2023.1.x milestone Apr 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
high priority Should be looked at before other PRs/issues
Projects
Status: done
Development

Successfully merging this pull request may close these issues.

2 participants