apps-android-commons
apps-android-commons copied to clipboard
[Bug]: No Precise Error Message After Error Due to Password Change
Summary
@whym @sivaraam @nicolas-raoul This Issue was first reported for Uploading Contributions at #5522 and Upon Further Investigation it was found that other issues are Occurring too After the Password is changed from the Commons Website.
What is happening is that the user's login is no longer valid and the User is required to log in again but the app gives no Error Message or Indication as to what went wrong.
As discussed in #5522 and more in #5544 User Should be Redirected to the Login Screen to log in Again.
This Issue aims to fix the following :
- [x] Sending Thanks In Review Activity, Nominating "No" in Review Activity
- [x] Sending "Thanks" for Contributions
- [x] Editing Depictions, Categories, Description, Coordinates for Contributions
- [x] Mark Notifications as Read
All these errors are arising due to the same reason and that's why I have made a Single Issue to Cover all this and will complete this in a Single PR, as discussed here #5522
Steps to reproduce
- Open the Open
- Select any Contribution and try to send "Thanks" or
- Select any Contribution and try to Edit Categories , depictions, descriptions or Coordinates or
- Open Review Activity
- Nominate "No" or Send "Thanks" to the Author
Expected behaviour
There should Precise Error Message as to why the action that the user is trying to perform has failed (Which in all of the above cases is that the User's Password has Changed making their current login Invalid) and it should redirect user to the Login Page.
Actual behaviour
There is no Error Message and All these Operations Just Fail Without any Message Leaving users Confused.
Device name
Xaomi 11 Lite NE
Android version
Android 13
Commons app version
4.2.1-debug-main
Device logs
java.lang.RuntimeException: App believes we're logged in, but got anonymous token.
at fr.free.nrw.commons.auth.csrf.CsrfTokenClient.getTokenBlocking(CsrfTokenClient.kt:51)
at fr.free.nrw.commons.actions.PageEditClient.prependEdit(PageEditClient.kt:60)
at fr.free.nrw.commons.delete.DeleteHelper.delete(DeleteHelper.java:106)
at fr.free.nrw.commons.delete.DeleteHelper.makeDeletion(DeleteHelper.java:67)
at fr.free.nrw.commons.delete.DeleteHelper.lambda$askReasonAndExecute$5$fr-free-nrw-commons-delete-DeleteHelper(DeleteHelper.java:223)
at fr.free.nrw.commons.delete.DeleteHelper$$ExternalSyntheticLambda6.call(Unknown Source:8)
at io.reactivex.internal.operators.single.SingleDefer.subscribeActual(SingleDefer.java:36)
at io.reactivex.Single.subscribe(Single.java:3603)
at io.reactivex.internal.operators.single.SingleSubscribeOn$SubscribeOnObserver.run(SingleSubscribeOn.java:89)
at io.reactivex.Scheduler$DisposeTask.run(Scheduler.java:578)
at io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:66)
at io.reactivex.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:57)
at javaa.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:307)
Screen-shots
No response
Would you like to work on the issue?
Yes
@nicolas-raoul @psh @whym Fixed the Issue with above PR , please review and let me know if there are any changes to be made, thanks