From 0cb593044492e4b5174ced8f5b5d778b9e07baa3 Mon Sep 17 00:00:00 2001 From: Alex Baker Date: Tue, 26 May 2020 18:24:33 -0500 Subject: [PATCH] Fix offline subtasks --- CHANGELOG.md | 4 ++++ app/build.gradle.kts | 4 ++-- .../java/org/tasks/data/TaskListQueryRecursive.kt | 14 +++++++------- app/src/main/res/values/changelog.xml | 1 + .../metadata/android/en-US/changelogs/90302.txt | 3 +++ 5 files changed, 17 insertions(+), 9 deletions(-) create mode 100644 fastlane/metadata/android/en-US/changelogs/90302.txt diff --git a/CHANGELOG.md b/CHANGELOG.md index ca6d2a11d..a0693570e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,10 @@ Change Log --- ======= +### 9.3.1 (2020-05-26) + +* Fix offline subtasks + ### 9.3 (2020-05-22) * Add manual sorting support for CalDAV and EteSync diff --git a/app/build.gradle.kts b/app/build.gradle.kts index e1ec51e58..05c32ab8b 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -37,8 +37,8 @@ android { defaultConfig { testApplicationId = "org.tasks.test" applicationId = "org.tasks" - versionCode = 90301 - versionName = "9.3" + versionCode = 90302 + versionName = "9.3.1" targetSdkVersion(Versions.targetSdk) minSdkVersion(Versions.minSdk) testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" diff --git a/app/src/main/java/org/tasks/data/TaskListQueryRecursive.kt b/app/src/main/java/org/tasks/data/TaskListQueryRecursive.kt index 514040522..c48da94d0 100644 --- a/app/src/main/java/org/tasks/data/TaskListQueryRecursive.kt +++ b/app/src/main/java/org/tasks/data/TaskListQueryRecursive.kt @@ -35,11 +35,6 @@ internal object TaskListQueryRecursive { .join(Join.inner(RECURSIVE, GoogleTask.PARENT.eq(RECURSIVE_TASK))) .join(Join.inner(GoogleTask.TABLE, Criterion.and(GoogleTask.TASK.eq(Task.ID), GoogleTask.DELETED.eq(0)))) .where(activeAndVisible()) - private val CALDAV_SUBTASKS = - QueryTemplate() - .join(Join.inner(RECURSIVE, Task.PARENT.eq(RECURSIVE_TASK))) - .join(Join.inner(CaldavTask.TABLE, Criterion.and(CaldavTask.TASK.eq(Task.ID), CaldavTask.DELETED.eq(0)))) - .where(activeAndVisible()) private val GOOGLE_AND_CALDAV_SUBTASKS = QueryTemplate() .join(Join.inner(RECURSIVE, Criterion.or(GoogleTask.PARENT.eq(RECURSIVE_TASK), Task.PARENT.eq(RECURSIVE_TASK)))) @@ -55,7 +50,10 @@ internal object TaskListQueryRecursive { when (filter) { is CaldavFilter -> { parentQuery = newCaldavQuery(filter) - subtaskQuery = CALDAV_SUBTASKS + subtaskQuery = QueryTemplate() + .join(Join.inner(RECURSIVE, Task.PARENT.eq(RECURSIVE_TASK))) + .join(Join.inner(CaldavTask.TABLE, Criterion.and(CaldavTask.TASK.eq(Task.ID), CaldavTask.DELETED.eq(0)))) + .where(activeAndVisible()) } is GtasksFilter -> { parentQuery = newGoogleTaskQuery(filter) @@ -66,7 +64,9 @@ internal object TaskListQueryRecursive { subtaskQuery = when { subtasks.hasGoogleSubtasks && subtasks.hasSubtasks -> GOOGLE_AND_CALDAV_SUBTASKS subtasks.hasGoogleSubtasks -> GOOGLE_SUBTASKS - else -> CALDAV_SUBTASKS + else -> QueryTemplate() + .join(Join.inner(RECURSIVE, Task.PARENT.eq(RECURSIVE_TASK))) + .where(activeAndVisible()) } joinedQuery += " LEFT JOIN (SELECT task, max(indent) AS max_indent FROM recursive_tasks GROUP BY task) AS recursive_indents ON recursive_indents.task = tasks._id " where += " AND indent = max_indent " diff --git a/app/src/main/res/values/changelog.xml b/app/src/main/res/values/changelog.xml index 64127dca0..9f964708f 100644 --- a/app/src/main/res/values/changelog.xml +++ b/app/src/main/res/values/changelog.xml @@ -2,6 +2,7 @@ Add manual sorting support for CalDAV and EteSync. Compatible with Nextcloud Tasks and Apple Reminders + Fix offline subtasks Update translations \ No newline at end of file diff --git a/fastlane/metadata/android/en-US/changelogs/90302.txt b/fastlane/metadata/android/en-US/changelogs/90302.txt new file mode 100644 index 000000000..d4db8b095 --- /dev/null +++ b/fastlane/metadata/android/en-US/changelogs/90302.txt @@ -0,0 +1,3 @@ +* Add manual sorting support for CalDAV and EteSync +* Fix offline subtasks +* Update translations