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 autosend when using unsupported auto-send values #6213

Merged
merged 4 commits into from
Jun 20, 2024

Conversation

seadowg
Copy link
Member

@seadowg seadowg commented Jun 19, 2024

Closes #6203

This makes the auto-send attribute behaviour (mostly) consistent with older versions. It works as described in the spec, with two additions:

  • Unsupported values (like "bubblegum", "desktop", "agent dale cooper" etc) are all treated as if there is no auto-send attribute and forms will be auto sent based on the setting in Collect. It's likely that people have been using "default" thinking that this means something, but it doesn't.
  • The supported values work if the case is wrong ("True" or "tRue" for example) and if they have extra whitespace (" true" for example).

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

The biggest change here was to introduce a three element enum to try and make this less confusing. The auto-send attribute isn't really a "true" or "false" system - it's a "true" or "false" or "undefined" and to add to that "true" and "false" aren't really opposites. I think going with "forced", "opt-out" and "neutral" is more descriptive.

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?

Nothing has changed except for auto send, but it's always a bit of a minefield due to the fact it has both a setting and a form attribute. I think waiting for a behaviour verified tag before merging would be good here.

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 marked this pull request as ready for review June 19, 2024 14:01
@seadowg seadowg requested a review from lognaturel June 19, 2024 14:01
Copy link
Member

@lognaturel lognaturel left a comment

Choose a reason for hiding this comment

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

Really like the naming. 👍

@seadowg seadowg merged commit baf4233 into getodk:master Jun 20, 2024
6 checks passed
@seadowg seadowg deleted the auto-send-truthy branch June 20, 2024 08:24
@dbemke
Copy link

dbemke commented Jun 20, 2024

Tested with Success!

Verified on a device with Android 10

Verified Cases:

@srujner
Copy link

srujner commented Jun 20, 2024

Tested with Success!

Verified on a device with Android 13

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

Successfully merging this pull request may close these issues.

A form is finalized (not sent) if there is "default" auto send setting in the form
4 participants