-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Hotfix for overwrite issue in 2.8.0 #1838
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
Hotfix for overwrite issue in 2.8.0 #1838
Conversation
…ion. What I did is checking the extension, and if it is null, adding .jpg suffix. Because commons files always have suffixes, and we should compare file names after adding suffixes. Othervise overrides are possible.
Perhaps we should also check 'title' is without any extension? Some of the tests fail because results like "SampleFile.jpg.jpg" are returned in UtilsFixExtensionTest (and I believe they should not). And I also suggest adding a new test like this:
We might have to read the content of the file and guess mimetype/extension. (I believe there is a library for doing that.) That could be a separate issue to be worked on, as it might take time to implement. |
Thanks for catching @whym . I never thought title with extension possibility. And I will add the test you offered:) |
Codecov Report
@@ Coverage Diff @@
## 2.8-release #1838 +/- ##
==============================================
+ Coverage 3.64% 3.67% +0.03%
==============================================
Files 188 188
Lines 9544 9547 +3
Branches 843 844 +1
==============================================
+ Hits 348 351 +3
Misses 9172 9172
Partials 24 24
Continue to review full report at Codecov.
|
Tests: Uploading a .jpg file via Share or in-app button both work, and does not overwrite Merging this for the hotfix anyway, thanks! |
@misaochan Can you share logs for this scenario. Edit: Ignore, I just saw your comment on the issue thread. :) |
* Add Traceur for getting meaningful RxJava stack traces (#1832) * Hotfix for overwrite issue in 2.8.0 (#1838) * This solution is an hotfix for overrite issue came back on 2.8.0 version. What I did is checking the extension, and if it is null, adding .jpg suffix. Because commons files always have suffixes, and we should compare file names after adding suffixes. Othervise overrides are possible. * Check if file title includes an extension already, by checking if is there any dot in it. * Fix logic error * Add uncovered tests * Remove unecessary line breaks * Make Javadocs more explicit * Versioning and changelog for v2.8.2 (#1842) * Versioning for v2.8.2 * Changelog for v2.8.2 * Add logs in wiki data edit and session refresh flow (#1874) * Fix logout (#1875) * [WIP] Refactor feedback and quiz to reduce possibility of NPE (#1881) * Refactor feedback and quiz to reduce possibility of NPE * Handle throwables in quiz checker * Minor refactoring * Set Traceur to only work in DEBUG mode (#1884) * Bug fix for uploaded images count in achievements activity (#1885) * Versioning and changelog for v2.8.3 (#1886) * Update changelog.md * Versioning for v2.8.3
* Add Traceur for getting meaningful RxJava stack traces (#1832) * Hotfix for overwrite issue in 2.8.0 (#1838) * This solution is an hotfix for overrite issue came back on 2.8.0 version. What I did is checking the extension, and if it is null, adding .jpg suffix. Because commons files always have suffixes, and we should compare file names after adding suffixes. Othervise overrides are possible. * Check if file title includes an extension already, by checking if is there any dot in it. * Fix logic error * Add uncovered tests * Remove unecessary line breaks * Make Javadocs more explicit * Versioning and changelog for v2.8.2 (#1842) * Versioning for v2.8.2 * Changelog for v2.8.2 * Delete unused MaterialShowcase class * Add Javadocs and fix lint errors for DirectUpload.java * Fix whitespace and add docs * Replace fragment.getActivity() with the parentActivity var * Rename unnecessarily-overloaded method getFromWikidataQuery(), add Javadocs * Javadocs and whitespaces for NearbyPlaces.java * Use local vars where possible instead of class fields. Non-constants should not be in all caps * Missed one unnecessary class field * Remove unnecessary whitespaces that don't improve readability * Add class summary * Optimize imports * Fix access modifiers in Place.java * Clearer Javadocs * Add Javadocs to Place.java * Remove residual conflict * Fix lint issues in Sitelinks * Javadocs for Sitelinks.java * DirectUpload: Replace nested conditionals with guard clauses
* Add Traceur for getting meaningful RxJava stack traces (#1832) * Hotfix for overwrite issue in 2.8.0 (#1838) * This solution is an hotfix for overrite issue came back on 2.8.0 version. What I did is checking the extension, and if it is null, adding .jpg suffix. Because commons files always have suffixes, and we should compare file names after adding suffixes. Othervise overrides are possible. * Check if file title includes an extension already, by checking if is there any dot in it. * Fix logic error * Add uncovered tests * Remove unecessary line breaks * Make Javadocs more explicit * Versioning and changelog for v2.8.2 (#1842) * Versioning for v2.8.2 * Changelog for v2.8.2 * Fix data template for other source
Title (required)
Fixes #228 Override happens
Description (required)
Fixes #228 What I did is checking the extension, and if it is null, adding .jpg suffix. Because commons files always have suffixes, and we should compare file names after adding suffixes. Otherwise overrides are possible.
Tests performed (required)
BetaDebug, API level 19 (this was the only emulator that I could reproduce the issue)
Fixedthe problem for me.