Tasks: [Feature Request] Bulk deletion of completed tasks.

Created on 10 Apr 2017  路  16Comments  路  Source: nextcloud/tasks

Steps to reproduce

  1. Click "Load remaining completed tasks." button.
    2.
    3.

Expected behaviour

Button or some other control/logic to allow bulk deletion of completed tasks.

Actual behaviour

No button or some other control/logic to allow bulk deletion of completed tasks.

Server configuration

Operating system:
Debian Jesse
Web server:
Lighttpd/1.4.35
Database:
MySql
PHP version:
5.5
Nextcloud version: (see Nextcloud admin page)
11.0.2
Tasks version: (see Nextcloud apps page)
0.9.5
Updated from an older Nextcloud or fresh install:
Fresh
Signing status:
No errors have been found.

Login as admin user into your Nextcloud and access 
http://example.com/index.php/settings/integrity/failed 
paste the results here.

List of activated apps:
Enabled:

  • activity: 2.4.1
  • calendar: 1.5.2
  • comments: 1.1.0
  • contacts: 1.5.3
  • dav: 1.1.1
  • federatedfilesharing: 1.1.1
  • federation: 1.1.1
  • files: 1.6.1
  • files_pdfviewer: 1.0.1
  • files_sharing: 1.1.1
  • files_texteditor: 2.2
  • files_trashbin: 1.1.0
  • files_versions: 1.4.0
  • files_videoplayer: 1.0.0
  • firstrunwizard: 2.0
  • gallery: 16.0.0
  • logreader: 2.0.0
  • lookup_server_connector: 1.0.0
  • nextcloud_announcements: 1.0
  • notifications: 1.0.1
  • password_policy: 1.1.0
  • provisioning_api: 1.1.0
  • rainloop: 4.28.1
  • serverinfo: 1.1.1
  • sharebymail: 1.0.1
  • survey_client: 0.1.5
  • systemtags: 1.1.3
  • tasks: 0.9.5
  • theming: 1.1.1
  • twofactor_backupcodes: 1.0.0
  • updatenotification: 1.1.1
  • workflowengine: 1.1.1
    Disabled:
  • admin_audit
  • encryption
  • external
  • files_accesscontrol
  • files_automatedtagging
  • files_external
  • files_retention
  • templateeditor
  • user_external
  • user_ldap
  • user_saml
If you have access to your command line run e.g.:
sudo -u www-data php occ app:list
from within your Nextcloud installation folder
feature

All 16 comments

Would like to have this feature, too!

please, implement this. Specially given how SLOW the UI gets ATM when you have many tasks

I second! I use DAVdroid to sync with a nextcloud server (server and tasks app up to date). Several days ago, I wondered about high battery load (~1.5A) and drain (~2-4%) when syncing. OS monitor showef full load on one CPU core for the OpenTasks Android app. A quick check revealed about 2k items (>95% completed) being synced several times a day.
Sure, one could argue it's not the server's tasks app error. But in contrast to calendar items (which by the way are handled correctly on the client side), task items not necessarily contain date information and sync cannot be selected specifically during sync to my understanding.
A "drop completed tasks" button would be perfect for my needs!

Would this command maybe help to be ran against the database?

DELETE FROM oc_calendarobjects WHERE calendardata LIKE '%STATUS:COMPLETED%' AND componenttype= 'VTODO'

It would, and, it did. But, the onus shouldn't be on the user (most aren't technically savvy enough) or the DB administrator. Adding a command button to the frontend and your query to the backend shouldn't be too difficult for the developers.

@slevit I totally agree, just wanted to know if it helps or maybe damages something else. I encountered low performance on android as well, so I will give it a try.

Actually, it's more complicated than that. You'll find the status of a task in the oc_calendarobjects_props table, then you'll have to take the objectid and find a match in the oc_calendarobjects table to determine if it's a VTODO. Only then can you delete the oc_calendarobjects row and all corresponding oc_calendarobjects_props rows. Foreign key constraints would be a big help, but that's a whole other kettle of fish. Backup your DB first and good luck.

I would strongly advise against messing with your database. The CalDAV tables are only meant to be altered by Nextcloud Server itself via the SabreDAV interface. Running queries against the database is like fiddling on your engine instead of using the gas pedal to accelerate your car. It might work, but the potential to mess things up completly is huge.

That being said, we will definitely not implement it by putting an sql query somewhere. This app is a CalDAV client, so we have to use the CalDAV interface. We can query the server for all completed tasks (which is done in the "Completed" collection) and then just delete all of them.

Ok, thanks for your feedback. I definitely won't make any manual changes to the database but, just for your information, the overview for completed tasks in Nextcloud itself (not in the Android app) does not show any tasks for me.

just for your information, the overview for completed tasks in Nextcloud itself (not in the Android app) does not show any tasks for me.

Completed tasks are not loaded by default to not slow down the app even more. You can load them for every calendar separately when you select a calendar and click on "Load remaining completed tasks".

But I guess we could improve the "Completed" view and show a button to load all completed tasks there as well (and one to delete all of them) 馃槂

Completed tasks are not loaded by default to not slow down the app even more. You can load them for every calendar separately when you select a calendar and click on "Load remaining completed tasks".

Unfortunately I do not see the button "Load remaining completed tasks". The list ist completely empty.
image

Yes, I didn't make it clear very well. You have to select a calendar (e.g. "Dennis" in your case) and click the button there.

If no completed tasks are present for a certain calendar, then the calendar will not be shown at all in the completed view, neither will be the button to load the completed tasks. This should be changed.

That's pretty much what my year-old feature request was all about to begin with. You have to admit that as the list of completed tasks grows, the more tedious the job becomes of deleting each one individually.

As for manually manipulating the DB, anyone not smart enough to back it up first, deserves whatever they get. The method I described to delete completed tasks by SQL query was in response to Yezariael's suggested workaround. I tested it successfully without causing any collateral damage. Though not the optimal solution, it does provide us more technically inclined users a viable stop-gap while waiting for you guys to catch up.

On Thu, 2018-08-30 at 02:08 -0700, Raimund Schl眉脽ler wrote:

But I guess we could improve the "Completed" view and show a button to load all completed tasks there as well (and one to delete all of them) 馃槂

I currently rewrite the app in Vue.js, because the currently used Angular is outdated and very difficult to maintain. I will implement this feature in the rewritten app. In the meantime you can just delete multiple completed tasks using Thunderbird + Lightning.

good to know that you are working in the new version! looking forward to it. The current one is almost perfect for me, if it wasn't so slow.

cheers!

Please have a look at #414

Was this page helpful?
0 / 5 - 0 ratings

Related issues

enboig picture enboig  路  9Comments

raimund-schluessler picture raimund-schluessler  路  7Comments

raimund-schluessler picture raimund-schluessler  路  8Comments

Valdnet picture Valdnet  路  7Comments

rullzer picture rullzer  路  6Comments