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

Bulk Delete for Messages #4112

Open SCdF opened 6 years ago

SCdF commented 6 years ago

@derickl mentioned this would be a useful feature.

Derick, could you fill out this ticket / add a comment please detailing what sort of thing you're looking for? Then the design team can work this into their design approach / schedule.

derickl commented 6 years ago

This may have been superseded (only for new projections) with blocking certain numbers at config level (deny list) but here goes.

One project comes to mind - VHW Burundi as per #2803.

This was a case where the MNO was spamming the gateway number and messages accumulated on the instance. IIRC, deletion was to be either one-by-one or scripted. Bulk delete would have allowed a PM to independently handle the cleanup issue.

@medic/tech-leads anyone with a comment here based on project experience?

nomulex commented 5 years ago

Can we extend the purging feature to messages ?

SCdF commented 5 years ago

@nomulex can you go into more detail about what you mean here? Purging is currently only for offline users, and so doesn't fit my understanding of how messages are used (ie by online "facility" users). If they are used by offline users then you could purge the reports that contain the messages using purging right now I believe.

Can you explain a bit more about what problem you're looking to solve here, and for what users / use cases?

nomulex commented 5 years ago

Sorry @SCdF , I had forgotten the offline bit. The partner I am dealing with receives a number of unstructured messages and they can get a bit cumbersome. The need is to delete some of these over time. Purging won't work. My apologies.

garethbowen commented 5 years ago

@derickl Are you thinking this would be available in the UI or as a CLI script?

Currently the UI is grouped by the contact so you can read the conversation. Do you want to be able to delete all the messages to/from a given contact, or do you need to bulk select certain messages within each conversation?

It sounds like the problem here is the UI getting bogged down with old messages. Are there changes we could make to sorting, filtering, searching, pagination, etc which would mean the UI works well without the user needing to clear out old messages?

derickl commented 5 years ago

@garethbowen I believe we'd need a couple of things:

It sounds like the problem here is the UI getting bogged down with old messages. Are there changes we could make to sorting, filtering, searching, pagination, etc which would mean the UI works well without the user needing to clear out old messages?

This would help homing on on a particular conversation

Currently the UI is grouped by the contact so you can read the conversation. Do you want to be able to delete all the messages to/from a given contact, or do you need to bulk select certain messages within each conversation?

When clearing conversations I think we can start with deleting threads (messages to/from a given contact). The only cases where I've seen deletion come up in in clearing entire threads e.g the old situations where you'd end up in an infinite reply loop triggered by MNO messages