diff --git a/F-Droid/src/org/fdroid/fdroid/data/DBHelper.java b/F-Droid/src/org/fdroid/fdroid/data/DBHelper.java index 98f1d39a0..ea3a153b0 100644 --- a/F-Droid/src/org/fdroid/fdroid/data/DBHelper.java +++ b/F-Droid/src/org/fdroid/fdroid/data/DBHelper.java @@ -437,9 +437,20 @@ public class DBHelper extends SQLiteOpenHelper { if (oldVersion < 50) { Log.i(TAG, "Recalculating app icon URLs so that the newly added large icons will get updated."); AppProvider.UpgradeHelper.updateIconUrls(context, db); + clearRepoEtags(db); } } + /** + * By clearing the etags stored in the repo table, it means that next time the user updates + * their repos (either manually or on a scheduled task), they will update regardless of whether + * they have changed since last update or not. + */ + private void clearRepoEtags(SQLiteDatabase db) { + Log.i(TAG, "Clearing repo etags, so next update will not be skipped with \"Repos up to date\"."); + db.execSQL("update " + TABLE_REPO + " set lastetag = NULL"); + } + private void resetTransient(SQLiteDatabase db, int oldVersion) { // Before version 42, only transient info was stored in here. As of some time // just before 42 (F-Droid 0.60ish) it now has "ignore this version" info which @@ -451,7 +462,7 @@ public class DBHelper extends SQLiteOpenHelper { .putBoolean("triedEmptyUpdate", false).commit(); db.execSQL("drop table " + TABLE_APP); db.execSQL("drop table " + TABLE_APK); - db.execSQL("update " + TABLE_REPO + " set lastetag = NULL"); + clearRepoEtags(db); createAppApk(db); } }