medic / cht-core

The CHT Core Framework makes it faster to build responsive, offline-first digital health apps that equip health workers to provide better care in their communities. It is a central resource of the Community Health Toolkit.
https://communityhealthtoolkit.org
GNU Affero General Public License v3.0
438 stars 208 forks source link

Error deleting documents on slow connection #8001

Open michaelkohn opened 1 year ago

michaelkohn commented 1 year ago

Describe the bug Users get an error when bulk deleting documents. The message they see says "Error deleting document".

To Reproduce Steps to reproduce the behavior:

  1. Log in as an online user with the ability to bulk delete reports
  2. Make your browser window small enough so that it is showing mobile view (single pane)
  3. Go to the reports tab
  4. Throttle your connection to "Slow 3G" or "Low-end mobile"
  5. Go into "Select" mode
  6. Select several (I did 4) reports
  7. Immediately tap on "Delete All"
  8. Tap on "Delete" on the confirmation page
  9. See the error

Expected behavior The documents I have selected should be deleted without error OR don't give me the option to delete until you are actually ready to delete them.

Logs

127-0-0-1.my.local-ip.co.har.txt

Screenshots/Videos

3.17.0

https://user-images.githubusercontent.com/10096985/209172384-ec306878-60f0-4872-9c4f-62a396afb0a9.mov

4.1.0

https://user-images.githubusercontent.com/10096985/209172437-9d5ff491-13a3-43be-a376-adcc9a95a240.mov

Environment

Additional context For me, this wasn't an issue on desktop in 3.17.0 because the "Delete All" action bar doesn't show up until everything it needs is loaded. On 4.1.0, the "Delete All" option shows up immediately so it is still an issue even on desktop.

At time of writing this, there have already been a few other issues identified related to bulk delete: https://github.com/medic/cht-core/issues/7300 , https://github.com/medic/cht-core/issues/7868 , https://github.com/medic/cht-core/issues/7883

1yuv commented 1 year ago

I experienced this issue today while trying to delete 3 or 4 reports submitted through sms, not on a throttled connection.

ngaruko commented 1 year ago

This ticket is in the No Status column, should we push it to To do @garethbowen ? Looks like we have two incidents.