From 68709227848348b55dfedae25fa4183ec2c28de1 Mon Sep 17 00:00:00 2001 From: schroda <50052685+schroda@users.noreply.github.com> Date: Sun, 17 May 2026 01:08:38 +0200 Subject: [PATCH] Fix chapter update failure db rollback (#2040) The deletion of chapter data was done in its own transaction. Thus, when the update or insertion failed later on, the deletion was not rolled back fixes #2031 Co-authored-by: Mitchell Syer --- CHANGELOG.md | 13 +++++++------ .../kotlin/suwayomi/tachidesk/manga/impl/Chapter.kt | 10 ++++------ 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index da46ff583..a0b3ca474 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,12 +14,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). - (Startup) Crash on startup if an unrecoverable error happens ### Fixed -- (CloudFlareInterceptor) Don't send the `cf_clearance` cookie back to Flaresolverr -- (WebUI) Handle serving non-default webui with "bundled" -- (WebUI) Wait until WebUI is ready to open in browser -- (Downloads) Truncate filenames by byte length to prevent "File name too long" IO errors -- (Extension) Do not indicate an update is available when the extension is not installed -- (Chapter) Fix database error when fetching chapter updates +- (**CloudFlareInterceptor**) Don't send the `cf_clearance` cookie back to Flaresolverr +- (**WebUI**) Handle serving non-default webui with "bundled" +- (**WebUI**) Wait until WebUI is ready to open in browser +- (**Downloads**) Truncate filenames by byte length to prevent "File name too long" IO errors +- (**Extension**) Do not indicate an update is available when the extension is not installed +- (**Chapter**) Fix losing chapter data on failed chapter list update +- (**Chapter**) Fix database error when fetching chapter updates ## [v2.2.2100] + [WebUI: v20260508.01] - 2026-05-08 diff --git a/server/src/main/kotlin/suwayomi/tachidesk/manga/impl/Chapter.kt b/server/src/main/kotlin/suwayomi/tachidesk/manga/impl/Chapter.kt index f8c9aaf8e..b6990861d 100644 --- a/server/src/main/kotlin/suwayomi/tachidesk/manga/impl/Chapter.kt +++ b/server/src/main/kotlin/suwayomi/tachidesk/manga/impl/Chapter.kt @@ -262,16 +262,14 @@ object Chapter { } } - // we got some clean up due - if (chaptersIdsToDelete.isNotEmpty()) { - DownloadManager.dequeue(chaptersIdsToDelete) - transaction { + transaction { + // we got some clean up due + if (chaptersIdsToDelete.isNotEmpty()) { + DownloadManager.dequeue(chaptersIdsToDelete) PageTable.deleteWhere { chapter inList chaptersIdsToDelete } ChapterTable.deleteWhere { id inList chaptersIdsToDelete } } - } - transaction { if (chaptersToInsert.isNotEmpty()) { ChapterTable .batchInsert(chaptersToInsert) { chapter ->