common-voice / sentence-collector

Tool to collect and review sentences for Common Voice
https://commonvoice.mozilla.org/sentence-collector/
Mozilla Public License 2.0
81 stars 64 forks source link

fix: stop persisting loading state #622

Closed paulotokimatu closed 2 years ago

paulotokimatu commented 2 years ago

In order to simulate the issue reported by #609 I added some artificial delay in the /review endpoint of the server and while the web app was trying to fetch the sentences I just had to change pages or refresh your browser. This will make the app stuck in the loading state.

As mentioned by @MichaelKohler, the easy solution is to not persist the loading state sentencesLoading.

The key isUploadingSentences is also a loading state, but I was not able to simulate any issues like above because it goes to the catch and the state goes back to false. I also added it in the exception list just for consistency sake, but I can remove if you all think it is better since it is not causing real problems for now.

I didn't add any tests since it this case would be better tested by some type of integration test, but doesn't look like we are using them in the repo, right?

MichaelKohler commented 2 years ago

:tada: This PR is included in version 2.17.5 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket: