Open Cologler opened 7 months ago
When two elements have the same key, if we query one from the database, it would be the first one; if we query all from the database and then map by associateBy()
, it would be the last one.
This inconsistency leads to numerous issues.
Even though the chapter_id
of history
has unique constraints, if the (manga_id, url)
of chapter
lacks unique constraints, then this is not unique:
This issue can lead to restoration failure with:
// <-- this is in my tachiyomi_restore.txt
ResultSet returned more than 1 row for history.sq:getHistoryByChapterUrl
By the way, since this is a relative URL, it might be duplicated across different sources. TachiyomiSY has already tried to fix this issue by use mangaId
:
Steps to reproduce
I have no idea where they come from. It might be because I'm refreshing the database while simultaneously importing data.
Expected behavior
The database is guarded by unique constraints.
Actual behavior
A lot of duplicated chapters:
Crash logs
No response
Mihon version
latest
Android version
12
Device
phone
Other details
Why the database does not have unique constraints like:
(manga_id, url)
onchapters
table(source, url)
onmangas
table(sort)
oncategories
tableSome related issues:
27
120
185
Acknowledgements