-
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
Remove empty instanceDir if a user quits the identity dialog #6020
Open
grzesiek2010
wants to merge
4
commits into
getodk:master
Choose a base branch
from
grzesiek2010:COLLECT-5921
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
org.robolectric\:android-all-instrumented\:6.0.1_r3-robolectric-r1-i6=../../../../../../robolectric-deps/android-all-instrumented-6.0.1_r3-robolectric-r1-i6.jar | ||
org.robolectric\:android-all-instrumented\:7.0.0_r1-robolectric-r1-i6=../../../../../../robolectric-deps/android-all-instrumented-7.0.0_r1-robolectric-r1-i6.jar | ||
org.robolectric\:android-all-instrumented\:12.1-robolectric-8229987-i6=../../../../../../robolectric-deps/android-all-instrumented-12.1-robolectric-8229987-i6.jar | ||
org.robolectric\:android-all-instrumented\:13-robolectric-9030017-i6=../../../../../../robolectric-deps/android-all-instrumented-13-robolectric-9030017-i6.jar | ||
org.robolectric\:android-all-instrumented\:14-robolectric-10818077-i6=../../../../../../robolectric-deps/android-all-instrumented-14-robolectric-10818077-i6.jar | ||
org.robolectric\:android-all-instrumented\:13-robolectric-9030017-i6=../../../../../../robolectric-depss/android-all-instrumented-13-robolectric-9030017-i6.jar | ||
org.robolectric\:android-all-instrumented\:14-robolectric-10818077-i6=../../../../../../robolectric-deps/android-all-instrumented-14-robolectric-10818077-i6.jar |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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'm wondering if there's more of a shared place we can handle this clean up. It looks like you can't call
FormSaveViewModel#ignoreChanges
in this scenario as theFormSaveViewModel
won't know about theFormController
yet.Where does this instance folder actually get created?
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.
It's here https://github.com/getodk/collect/blob/master/collect_app/src/main/java/org/odk/collect/android/activities/FormFillingActivity.java#L1960
I was also thinking about that and I'm aware of the fact that this solution is maybe not perfect but I wasn't able to find a better one. If there is a form that requires identity we don't even save
formController
before passing it formControllerAvailable so it's not available in other places to read the dir parth and remove.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.
Maybe we could pull a chunk of the code in
FormSaveViewModel#ignoreChanges
out into a use case that can be called in both places? Thinking about thatI'm actually wondering whether if the clean up code in
ignoreChanges
should just be called whenever we end form filling? It might be that we could start thinking ofFormSessionRepository
more like one of our data services and move logic like that in there (it could be triggered fromclear
for example).Maybe I'm thinking about this incorrectly, but the bug doesn't feel high priority enough to not take these opportunities to restructure while fixing it.
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.
FormSaveViewModel as the name suggest is responsible for saving-related operations. using it in this case where we don't even enter the form-filling view sounds a little bit weird to me. Do you really think it would be a better place?
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 was more meaning the shared code would move out
FormSaveViewModel
to a separate use case rather than using it in both places.