[PR #480] [CLOSED] Fix bug when add new bookmark using PostgreSQL #610

Closed
opened 2026-02-25 23:34:53 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/go-shiori/shiori/pull/480
Author: @fukajun
Created: 9/28/2022
Status: Closed

Base: masterHead: fix-bug-pg


📝 Commits (2)

  • 8bed91d Fix bug when add new bookmark with postgresql
  • dfe4793 Consider the initial state of the sequence

📊 Changes

1 file changed (+1 additions, -1 deletions)

View changed files

📝 internal/database/pg.go (+1 -1)

📄 Description

Fixed a bug pages not archived although createArchive checkbox checked. (fix: https://github.com/go-shiori/shiori/issues/385)

Maybe it is only occurred using postgres.
To be precise, the archive is saved, but the ID to refer to different.

This ploblem reason is diffrent create file path id(archive and thumb) and create bookmark record id.

Function of CreatNewID return recently numbered bookmark id that is not same to be insert bookmark record id.
Returned bookmark id is used to path of save thumb and archive.
But, record inserted by next numbered id.
As a result, New bookmark record try to refered not exists directory pathes.

This fix will be changes CreateNewID returned to be next numbered bookmark record id.

Excuse, This implements is not think about concurrency bookmarking.
But, Current implement is same about this point.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/go-shiori/shiori/pull/480 **Author:** [@fukajun](https://github.com/fukajun) **Created:** 9/28/2022 **Status:** ❌ Closed **Base:** `master` ← **Head:** `fix-bug-pg` --- ### 📝 Commits (2) - [`8bed91d`](https://github.com/go-shiori/shiori/commit/8bed91d57540b2b3949b3ac243fd164e5a5ca120) Fix bug when add new bookmark with postgresql - [`dfe4793`](https://github.com/go-shiori/shiori/commit/dfe47937961b6336f678580248fe7613d9a72c27) Consider the initial state of the sequence ### 📊 Changes **1 file changed** (+1 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `internal/database/pg.go` (+1 -1) </details> ### 📄 Description Fixed a bug pages not archived although createArchive checkbox checked. (fix: https://github.com/go-shiori/shiori/issues/385) Maybe it is only occurred using postgres. To be precise, the archive is saved, but the ID to refer to different. This ploblem reason is diffrent create file path id(archive and thumb) and create bookmark record id. Function of CreatNewID return recently numbered bookmark id that is not same to be insert bookmark record id. Returned bookmark id is used to path of save thumb and archive. But, record inserted by next numbered id. As a result, New bookmark record try to refered not exists directory pathes. This fix will be changes CreateNewID returned to be next numbered bookmark record id. Excuse, This implements is not think about concurrency bookmarking. But, Current implement is same about this point. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-25 23:34:53 +03:00
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#610
No description provided.