onionshare / onionshare-android

Android version of OnionShare
https://onionshare.org/
GNU General Public License v3.0
141 stars 16 forks source link

State refactoring #92

Closed akwizgran closed 9 months ago

akwizgran commented 11 months ago

Opening this draft PR so we can discuss the work in progress.

akwizgran commented 9 months ago

While investigating this strangeness I noticed a small bug on this branch that doesn't exist on main.

If Tor fails to bootstrap but zipping succeeds then the UI is left in the error state (as expected) and the list of files is not empty (as expected). If I then clear the list of files, the UI doesn't return to the welcome screen (it does on the main branch). The "Try again" button remains visible and it's possible to try again with an empty list of files. Whereas in all other circumstances, clearing the list of files returns me to the welcome screen.

You can reproduce this by turning off the phone's internet connection and then waiting for the bootstrapping attempts to time out.

grote commented 9 months ago

If I then clear the list of files, the UI doesn't return to the welcome screen (it does on the main branch).

I added a fix for this now as well.