[GH-ISSUE #364] Each time a bookmark is updated it adds a duplicate content entry #239

Closed
opened 2026-02-25 23:33:46 +03:00 by kerem · 2 comments
Owner

Originally created by @fmartingr on GitHub (Feb 11, 2022).
Original GitHub issue: https://github.com/go-shiori/shiori/issues/364

I had a problem with my database and had to start from a backup. I added a few of my missing bookmarks but forgot to add the tags, so when I edited them, it started showing up as duplicates in the frontend.

Screenshot 2022-02-11 at 19 52 00

This is a backend issue, since I checked the XHR requests and it showed up several times in the list, gladly with the same ID meaning its not duplicated in the database so it may be a problem with the SQL?

Screenshot 2022-02-11 at 19 52 59

This also happen when searching.

Originally created by @fmartingr on GitHub (Feb 11, 2022). Original GitHub issue: https://github.com/go-shiori/shiori/issues/364 I had a problem with my database and had to start from a backup. I added a few of my missing bookmarks but forgot to add the tags, so when I edited them, it started showing up as duplicates in the frontend. <img width="1995" alt="Screenshot 2022-02-11 at 19 52 00" src="https://user-images.githubusercontent.com/812088/153652284-17ad3e1a-c6d5-448c-8a4b-cc120da2fdb2.png"> This is a backend issue, since I checked the XHR requests and it showed up several times in the list, gladly with the same ID meaning its not duplicated in the database so it may be a problem with the SQL? <img width="727" alt="Screenshot 2022-02-11 at 19 52 59" src="https://user-images.githubusercontent.com/812088/153652403-45f26bec-6798-43b9-b879-9d3837b61b13.png"> This **also happen when searching**.
Author
Owner

@fmartingr commented on GitHub (Feb 12, 2022):

Offending code: github.com/go-shiori/shiori@2ca628b7fe/internal/database/sqlite.go (L160-L161)

<!-- gh-comment-id:1037331685 --> @fmartingr commented on GitHub (Feb 12, 2022): Offending code: https://github.com/go-shiori/shiori/blob/2ca628b7fe8f6bc86cb2367a2ed964a1e9f083db/internal/database/sqlite.go#L160-L161
Author
Owner

@fmartingr commented on GitHub (Feb 13, 2022):

Will be fixed in next release, manual SQL to remove duplicates from bookmarks_content:

DELETE FROM bookmark_content
WHERE rowid NOT IN (
    SELECT min(rowid)
    FROM bookmark_content
    GROUP BY docid
)   
<!-- gh-comment-id:1038369558 --> @fmartingr commented on GitHub (Feb 13, 2022): Will be fixed in next release, manual SQL to remove duplicates from `bookmarks_content`: ``` sql DELETE FROM bookmark_content WHERE rowid NOT IN ( SELECT min(rowid) FROM bookmark_content GROUP BY docid ) ```
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/shiori#239
No description provided.