-
-
Notifications
You must be signed in to change notification settings - Fork 366
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bulk modifying chapter read status caused all progress for user to be unread #3459
Comments
I encountered the same issue and created some SQL queries to address it. To check for duplicate entries, you can use the following query: SELECT *
FROM AppUserProgresses
WHERE (AppUserId, ChapterId) IN (
SELECT
AppUserId,
ChapterId
FROM
AppUserProgresses
GROUP BY
AppUserId,
ChapterId
HAVING
COUNT(*) > 1
); If duplicates are found, you can remove them using this query: WITH DuplicateRows AS (
SELECT
*,
ROW_NUMBER() OVER (PARTITION BY AppUserId, ChapterId ORDER BY PagesRead DESC, Id) AS RowNum
FROM
AppUserProgresses
)
DELETE FROM AppUserProgresses
WHERE Id IN (
SELECT Id
FROM DuplicateRows
WHERE RowNum > 1
); This query retains the entry with the highest PagesRead value. For instance, if there are two entries with PagesRead values of 15 and 3, it will keep the 15 and delete the 3. Important: As @Fesaa mentioned, please proceed with caution. Ensure you fully understand the queries before executing them. It is strongly recommended to back up your data beforehand to avoid any unintended data loss. |
What happened?
I had a series that I marked as unread and it caused all of the read progress of my user to be unread. I was able to narrow down the issue to when i used the bulk select and mark read/unread on a specific chapter in that series.
I dug into the database and found that the chapter in question had 2 read entries for my user.
I deleted these rows from the DB and the series is now working as intended.
What did you expect?
Changing the read progress of one series shouldn't affect the state of unrelated series.
Kavita Version Number - If you don not see your version number listed, please update Kavita and see if your issue still persists.
0.8.4.2 - Stable
What operating system is Kavita being hosted from?
Docker (Dockerhub Container)
If the issue is being seen on Desktop, what OS are you running where you see the issue?
Windows
If the issue is being seen in the UI, what browsers are you seeing the problem on?
Microsoft Edge
If the issue is being seen on Mobile, what OS are you running where you see the issue?
None
If the issue is being seen on the Mobile UI, what browsers are you seeing the problem on?
No response
Relevant log output
No response
Additional Notes
I have backups that can be provided as needed
The text was updated successfully, but these errors were encountered: