From 78fb398e0369a81b4c2d56400e99e36b601354bf Mon Sep 17 00:00:00 2001 From: Conatum Date: Fri, 7 Jul 2023 23:33:10 +0300 Subject: [PATCH] fix (tasklist): More bugfixes. Fix issue where save did not send all tasks. Fix issue where tasklist update would also affect deleted tasks. --- src/modules/tasklist/tasklist.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/modules/tasklist/tasklist.py b/src/modules/tasklist/tasklist.py index 775c78f5..87b705fb 100644 --- a/src/modules/tasklist/tasklist.py +++ b/src/modules/tasklist/tasklist.py @@ -174,7 +174,10 @@ class Tasklist: Update every task in the tasklist, regardless of cache. """ kwargs.setdefault('last_updated_at', utc_now()) - tasks = await self.data.Task.table.update_where(userid=self.userid).set(**kwargs) + tasks = await self.data.Task.table.update_where( + userid=self.userid, + deleted_at=None + ).set(**kwargs) return tasks @@ -286,8 +289,6 @@ class Tasklist: prefix = ' ' * (len(label) - 1) box = '- [ ]' if task.completed_at is None else '- [x]' line = f"{prefix}{box} {task.content}" - if total_len + len(line) > 4000: - break lines[task.taskid] = line total_len += len(line) return lines