collect icon indicating copy to clipboard operation
collect copied to clipboard

Fixed autosend

Open grzesiek2010 opened this issue 1 year ago • 1 comments

Closes #5191

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

I've added new tests and tested the fix manually.

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

This is a result of our discussion from https://github.com/getodk/collect/pull/5047. We decided that AutoSendTaskSpec should be simple and not responsible for checking network conditions. That's why I moved checking if auto send should be triggered out of that class to small separated classes that we can test easily.

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 fix the issue but the pr also contains some additional refactoring so please test autosend carefully.

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

No.

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:

  • [x] run ./gradlew checkAll and confirmed all checks still pass OR confirm CircleCI build passes and run ./gradlew connectedDebugAndroidTest locally.
  • [x] verified that any code or assets from external sources are properly credited in comments and/or in the about file.
  • [x] verified that any new UI elements use theme colors. UI Components Style guidelines

grzesiek2010 avatar Sep 06 '22 16:09 grzesiek2010

@seadowg this is a new implementation of https://github.com/getodk/collect/pull/5047. No rush but when you have time please take a look to that it won't hang too long like the previous pull request.

grzesiek2010 avatar Sep 06 '22 20:09 grzesiek2010

@grzesiek2010 I'm liking the structure of this a lot! Was going to dig a little deeper, but are there any other changes you'd like to make first before this comes out of draft?

seadowg avatar Nov 03 '22 10:11 seadowg

@grzesiek2010 I'm liking the structure of this a lot! Was going to dig a little deeper, but are there any other changes you'd like to make first before this comes out of draft?

No I left it as a draft but I don't have anything else to add so You can continue reviewing.

grzesiek2010 avatar Nov 03 '22 11:11 grzesiek2010

Android version

10, 13

Device used

Redmi 9T, Pixel 6a

Problem description

Forms with auto send set to false are send automatically when in settings user chooses options that sends forms automatically (e.g. auto send-wifi only with wifi on, auto send-cellular only with SIM card and wifi off)

Steps to reproduce the problem

  1. In Collect go to settings → form management → auto send.
  2. Choose "wifi or cellular".
  3. Go to Auto-Send_False_Auto-Delete_False form. Auto-Send_False_Auto-Delete_False.xml.txt
  4. Fill and finalize the form.

Expected behavior

The form should not be sent automatically.

Other information

On master ffcb17ff5ca59c10b5643311e0164a06c79767d5 the form works as expected.

dbemke avatar Nov 08 '22 10:11 dbemke

@dbemke The problem should be solved.

grzesiek2010 avatar Nov 08 '22 11:11 grzesiek2010

Tested with Success!

Verified on Android 10

Verified Cases:

  • issue #5191 and the issue with forms with autosend set to false are no longer reproducing
  • auto send: off, wifi only, cellular, wifi or cellular
  • with/ without SIM card
  • wifi on/off
  • switching between projects with different settings in auto send
  • changing auto send settings in duplicate project
  • auto sending submissions
  • sending submissions manually
  • finilizing an edited form
  • form with auto send set to true/false and auto delete set to true/false

dbemke avatar Nov 09 '22 09:11 dbemke

Tested with Success!

Verified on Android 13

srujner avatar Nov 09 '22 10:11 srujner