mirror of
https://github.com/Suwayomi/Suwayomi-Server.git
synced 2026-07-04 03:14:40 -05:00
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 <Syer10@users.noreply.github.com>
This commit is contained in:
13
CHANGELOG.md
13
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
|
- (Startup) Crash on startup if an unrecoverable error happens
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
- (CloudFlareInterceptor) Don't send the `cf_clearance` cookie back to Flaresolverr
|
- (**CloudFlareInterceptor**) Don't send the `cf_clearance` cookie back to Flaresolverr
|
||||||
- (WebUI) Handle serving non-default webui with "bundled"
|
- (**WebUI**) Handle serving non-default webui with "bundled"
|
||||||
- (WebUI) Wait until WebUI is ready to open in browser
|
- (**WebUI**) Wait until WebUI is ready to open in browser
|
||||||
- (Downloads) Truncate filenames by byte length to prevent "File name too long" IO errors
|
- (**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
|
- (**Extension**) Do not indicate an update is available when the extension is not installed
|
||||||
- (Chapter) Fix database error when fetching chapter updates
|
- (**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
|
## [v2.2.2100] + [WebUI: v20260508.01] - 2026-05-08
|
||||||
|
|
||||||
|
|||||||
@@ -262,16 +262,14 @@ object Chapter {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
transaction {
|
||||||
// we got some clean up due
|
// we got some clean up due
|
||||||
if (chaptersIdsToDelete.isNotEmpty()) {
|
if (chaptersIdsToDelete.isNotEmpty()) {
|
||||||
DownloadManager.dequeue(chaptersIdsToDelete)
|
DownloadManager.dequeue(chaptersIdsToDelete)
|
||||||
transaction {
|
|
||||||
PageTable.deleteWhere { chapter inList chaptersIdsToDelete }
|
PageTable.deleteWhere { chapter inList chaptersIdsToDelete }
|
||||||
ChapterTable.deleteWhere { id inList chaptersIdsToDelete }
|
ChapterTable.deleteWhere { id inList chaptersIdsToDelete }
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
transaction {
|
|
||||||
if (chaptersToInsert.isNotEmpty()) {
|
if (chaptersToInsert.isNotEmpty()) {
|
||||||
ChapterTable
|
ChapterTable
|
||||||
.batchInsert(chaptersToInsert) { chapter ->
|
.batchInsert(chaptersToInsert) { chapter ->
|
||||||
|
|||||||
Reference in New Issue
Block a user