-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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 forms not being deletable #6369
Conversation
class InstanceTest { | ||
|
||
@Test | ||
fun `canDeleteBeforeSend is true by default`() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have that test whenFormHasCreatedEntity_doesNotAppearInListToDelete
:
- Please clarify what
created entity
means. You can add a comment or change the test name to make it clear that it takes place on finalizing. - I think it would be good to have a test in the same class where we just save a form as a draft and test if it can be deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be good to have a test in the same class where we just save a form as a draft and test if it can be deleted.
I'd thought about that (I actually wrote that test then deleted it), but I realized we already had a test for finalized forms and felt like adding this unit test was simpler than testing all the possible states that saved forms could be in.
@@ -83,7 +83,7 @@ public static class Builder { | |||
private String geometry; | |||
|
|||
private Long dbId; | |||
private boolean canDeleteBeforeSend; | |||
private boolean canDeleteBeforeSend = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it handled correctly when forms are synced from disk and should be finalized?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean if a form has an entity? We don't currently support local entity creation/updates for synced instances. Otherwise, every Instance
should now be deletable.
Sent instances of forms that create or update entity still can't be deleted, those instances do not appear in delete form - saved forms. |
Could you file an issue? As far as I can tell, we should be OK to delete sent forms that create/update entities. We can discuss over at the issue though. |
Tested with Success Verified on device with Android 14 Verified cases:
|
Tested with Success Verified on device with Android 10 |
Closes #6338
Why is this the best possible solution? Were any other approaches considered?
Not a lot to discuss! The problem was just that
Instance
objects created viaInstance.Builder
had the wrong default value.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?
This should just fix the issue. It'll be good to check that forms can be deleted when expected.
Before submitting this PR, please make sure you have:
./gradlew connectedAndroidTest
(or./gradlew testLab
) and confirmed all checks still passDateFormatsTest