-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[WIP] Refactor feedback and quiz to reduce possibility of NPE #1881
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
Conversation
app/src/main/java/fr/free/nrw/commons/mwapi/ApacheHttpClientMediaWikiApi.java
Show resolved
Hide resolved
Looks good to me, thanks @maskaravivek :) . Happy to merge when it has been completed, pending successful tests. Please test with: |
Codecov Report
@@ Coverage Diff @@
## 2.8-release #1881 +/- ##
==============================================
+ Coverage 3.67% 3.72% +0.05%
==============================================
Files 188 190 +2
Lines 9555 9552 -3
Branches 846 848 +2
==============================================
+ Hits 351 356 +5
+ Misses 9180 9172 -8
Partials 24 24
Continue to review full report at Codecov.
|
I have a question first, does this feature active in beta too? I assume so. Test 1(beta)- No crash Now quiz checker dialog is called, but twice... I confirm that it also happens on master, so this PR does its job well. I couldn't reproduce the crash in either cases. |
@neslihanturan I would check on prod just to be sure. Not much point checking beta, especially as we're not sure if the revert count API works on beta. You don't need to actually upload bad images on your account, just use the debugger to simulate the revert count values for Test (2). |
Yes, I think we should test on prod indeed. |
@misaochan @neslihanturan The PR is ready for review now. :) |
Test 1 works for me on prod (Nexus S API 24)!! Spent 10 mins uploading stuff, going to different parts of the app, relogging, etc, and no crash. :) Test 2... I actually can't seem to get the quiz to trigger via the old debugger method, I guess because the flow has changed. Manually changing the code like @neslihanturan did worked, though. I will test a bit more to see if this works with the debugger (and @maskaravivek or anyone else with a high revert % from all the old test uploads, would be great if you could test ;)), but am leaning towards merging anyway. |
* 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
Title (required)
Fixes #1876
Description (required)
Fixes #1876
Have refactored some pieces of feedback and quiz to reduce NPE scenario. Have marked the PR as WIP as I have tested it just once and will go through these two modules once again to further handle crash prone cases.
Tests performed (required)
Tested both the achievements and quiz module on Redmi 5.