From baa0de428f17e7aacc6db05cea775baceb5c5168 Mon Sep 17 00:00:00 2001 From: tobiasKaminsky Date: Fri, 6 Nov 2020 15:33:59 +0100 Subject: [PATCH] Reset eTag so that capability get parsed again, so status is set Signed-off-by: tobiasKaminsky --- .../com/owncloud/android/db/ProviderMeta.java | 2 +- .../android/providers/FileContentProvider.java | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/owncloud/android/db/ProviderMeta.java b/src/main/java/com/owncloud/android/db/ProviderMeta.java index ce29ce0619..e7e6d11c64 100644 --- a/src/main/java/com/owncloud/android/db/ProviderMeta.java +++ b/src/main/java/com/owncloud/android/db/ProviderMeta.java @@ -35,7 +35,7 @@ import java.util.List; */ public class ProviderMeta { public static final String DB_NAME = "filelist"; - public static final int DB_VERSION = 60; + public static final int DB_VERSION = 61; private ProviderMeta() { // No instance diff --git a/src/main/java/com/owncloud/android/providers/FileContentProvider.java b/src/main/java/com/owncloud/android/providers/FileContentProvider.java index 2a54561626..c11c73c555 100644 --- a/src/main/java/com/owncloud/android/providers/FileContentProvider.java +++ b/src/main/java/com/owncloud/android/providers/FileContentProvider.java @@ -2288,6 +2288,23 @@ public class FileContentProvider extends ContentProvider { if (!upgraded) { Log_OC.i(SQL, String.format(Locale.ENGLISH, UPGRADE_VERSION_MSG, oldVersion, newVersion)); } + + if (oldVersion < 61 && newVersion >= 61) { + Log_OC.i(SQL, "Entering in the #61 reset eTag to force capability refresh"); + db.beginTransaction(); + try { + db.execSQL("UPDATE capabilities SET etag = '' WHERE 1=1"); + + upgraded = true; + db.setTransactionSuccessful(); + } finally { + db.endTransaction(); + } + } + + if (!upgraded) { + Log_OC.i(SQL, String.format(Locale.ENGLISH, UPGRADE_VERSION_MSG, oldVersion, newVersion)); + } } } }