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

Do not lock the forms db when a form uses entities but is started in view-only mode #6487

Merged
merged 4 commits into from
Oct 31, 2024

Conversation

grzesiek2010
Copy link
Member

@grzesiek2010 grzesiek2010 commented Oct 30, 2024

Closes #6485

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

When opening forms in view-only mode (forms that can't be edited), it doesn't make sense to block downloading updates, nor does it make sense to block opening such forms during these processes.
There’s nothing to discuss regarding the implementation, as the location where this case needs to be handled is clear - FormUriActivity.

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?

We need to test opening finalized and sent forms (forms that can't be edited) to ensure they don't block form updates and can still be opened during such processes.

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:

  • 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 October 30, 2024 14:43
@grzesiek2010 grzesiek2010 requested a review from seadowg October 30, 2024 14:43
@@ -1144,6 +1144,37 @@ class FormUriActivityTest {
)
}

@Test
fun `When attempting to view a non-editable form that uses entities and the forms database is locked then start form for view only`() {
Copy link
Member

Choose a reason for hiding this comment

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

Would this test not be enough? We'd maybe want to add an assertion that here that opening the view-only form doesn't lock the forms change lock, but I'm not sure if we need the two connected tests?

Copy link
Member Author

Choose a reason for hiding this comment

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

I have added one extra test here and removed those connected ones.


fun clickOnExit(): SendFinalizedFormPage {
clickOnString(org.odk.collect.strings.R.string.exit)
return SendFinalizedFormPage()
Copy link
Member

Choose a reason for hiding this comment

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

This should be return SendFinalizedFormPage().assertOnPage()

Copy link
Member Author

Choose a reason for hiding this comment

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

Actually, this method is no longer used so I removed it al all.

@grzesiek2010 grzesiek2010 requested a review from seadowg October 31, 2024 12:57
@seadowg seadowg merged commit 1a10357 into getodk:master Oct 31, 2024
6 checks passed
@dbemke
Copy link

dbemke commented Nov 4, 2024

Tested with Success!

Verified on a device with Android 10

Verified cases:

@WKobus
Copy link

WKobus commented Nov 4, 2024

Tested with Success!

Verified on a device with Android 15

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.

Entity form opening and match exactly blocked after opening finalized entity form in ready to send
4 participants