-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Remove current location retrieval from upload process entirely #1644
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 current location retrieval from upload process entirely #1644
Conversation
…nto 2.8-release-fork
…nto 2.8-release-fork
Codecov Report
@@ Coverage Diff @@
## 2.8-release #1644 +/- ##
==============================================
+ Coverage 3.87% 3.9% +0.03%
==============================================
Files 150 150
Lines 7571 7501 -70
Branches 710 703 -7
==============================================
Hits 293 293
+ Misses 7261 7191 -70
Partials 17 17
Continue to review full report at Codecov.
|
Tested on real device (API 24) and it worked fine. An upload with no EXIF location info has no location template and an upload with EXIF location ifo has one. |
android:title="@string/preference_category_location"> | ||
|
||
<SwitchPreference | ||
android:key="allowGps" |
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.
What do you think of the idea of leaving some trace of the key string "allowGps" so that future developers will not accidentally reuse it? (e.g. "// key 'allowGps' was used before - do not reuse it unless you revive the same feature.")
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.
Sounds like a good plan, but where should we mention this?
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 thinking we could do that in preferences.xml in place of the removed code. Or maybe somewhere in the wiki pages?
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.
Makes sense to me - added a comment there. :) Are we all good to merge?
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 made a suggestion but it doesn't mean I'm disapproving this even if the suggestion is not applied.)
IMHO, it's better to remove functions that aren't used in the app as it would confuse the person who would be reading the related code in the future. Not many would expect dead code to be held back intentionally. It might also improve code hygiene. You could always get them back with a Just for the sake of an example and nothing more, the Wikipedia app recently had a feature called "Offline library" which was actively developed until a month back or so. Since they discovered potential blockers for the feature they're shelving the feature for now. For that removed the relevant code completely rather than keeping it back. |
I also generally believe that unused code should be removed, to make the code smaller. |
Thanks for the feedback guys. Will do that soon. :) |
Removed unused code. :) |
@misaochan I have tested and get this error on beggining of app:
|
Re-installing the app solves the crash. |
Hmm. It is still a legit error, but doesn't appear to be related to this PR - I haven't modified any code in the Contributions package at all. Should we create a new issue for it? Might be a bit difficult to reproduce though, haha. |
If you have an old installation on an emulator, can you try to pull your changes there and test? I think the error will be appeared then. I didn't experienced this error on other branches. |
@neslihanturan I did as you described and could not reproduce the error. I do think it's very unlikely to be caused by this PR as none of the classes in the stack trace were modified. I would suggest merging if it otherwise works for you, and if the issue reoccurs when we test the branch, we can fix it. Either way, I don't think the fix should be in this PR, but rather a separate one. Edit: It seems according to https://stackoverflow.com/questions/24053786/cant-downgrade-database-from-version-2-to-1-even-after-fresh-install-and-re-run that the cause could be code on the previous version of the app erroneously incrementing the DB version. So that explains why I wasn't able to reproduce it, since I would likely have used a different "old installation" from yours. Which branch were you testing prior to this one, do you remember? |
It appears that the DB version was changed in the 'browse' branch from 6 to 7: ae09445#diff-1c0d8106634cdf0a1f9d0087c46c3e9d So I think we are safe to ignore it in this particular PR. The DB downgrade issue is tracked in #1589. |
I tested it again with a betaRelease build and it still worked fine for me. :) |
Thanks for testing again, @whym . :) Would anyone like to go ahead and merge? |
android:summary="@string/allow_gps_summary" /> | ||
|
||
</PreferenceCategory> | ||
<!-- The key 'allowGps' was used before and has since been removed based on the discussion at #1599. |
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.
Nice that you added this comment here. :)
Temporary fix for #1599 . We are concerned that people who enabled the "automatically get current location" setting prior to the subtext change may not realize that their location is being added to the image's location template. This removes current location retrieval entirely from the upload process, and removes the Setting as well.
Where possible, I have left methods intact so that in the future if we decide to reimplement this (retrieving current location solely for category suggestions but not adding it to the template), we will not need to rewrite code. However, I have removed most of the method calls, and methods that would affect the user (e.g. the snackbar requesting location permissions).
As an added bonus, this should fix #1515 since the LocationListener will not be registered in ShareActivity.
Tested on Nexus S emulator running API 25 on betaDebug. To test: