[PR #518] [MERGED] fix(api-ext): use same save logic as the api #638

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

📋 Pull Request Information

Original PR: https://github.com/go-shiori/shiori/pull/518
Author: @fmartingr
Created: 10/15/2022
Status: Merged
Merged: 10/15/2022
Merged by: @fmartingr

Base: masterHead: issue-517


📝 Commits (3)

  • d0c92e5 switched session priority to header then cookie
  • 23660b7 fix(db): GetBookmarks handle no rows error
  • 3ef3f57 fix(api-ext): using same save logic as the api

📊 Changes

6 files changed (+55 additions, -31 deletions)

View changed files

📝 internal/database/database_test.go (+30 -1)
📝 internal/database/mysql.go (+1 -1)
📝 internal/database/pg.go (+1 -1)
📝 internal/database/sqlite.go (+1 -1)
📝 internal/webserver/handler-api-ext.go (+16 -17)
📝 internal/webserver/handler.go (+6 -10)

📄 Description

  • Modified the extension API to use the same save flow as the regular API, by generating the bookmark first and trying to archive it later. This will result in a stored bookmark even if the archiving fails.
  • Switched the session priority, now the header has more priority than the cookie, witch should be the default, since the webserver sends the cookie and the extension requires the session anyway.
  • Fixed the DB.GetBookmark method by handling the sql.ErrNoRows silently (since it already exposes a bool).

Fixes #517


🔄 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/518 **Author:** [@fmartingr](https://github.com/fmartingr) **Created:** 10/15/2022 **Status:** ✅ Merged **Merged:** 10/15/2022 **Merged by:** [@fmartingr](https://github.com/fmartingr) **Base:** `master` ← **Head:** `issue-517` --- ### 📝 Commits (3) - [`d0c92e5`](https://github.com/go-shiori/shiori/commit/d0c92e53e0eab4f5f9f080f2a59ee51de358c6af) switched session priority to header then cookie - [`23660b7`](https://github.com/go-shiori/shiori/commit/23660b727110af036ebdff7a18b78d3f90b3bb78) fix(db): GetBookmarks handle no rows error - [`3ef3f57`](https://github.com/go-shiori/shiori/commit/3ef3f5745b3779ec4ce293a2f4fa24c8ff872032) fix(api-ext): using same save logic as the api ### 📊 Changes **6 files changed** (+55 additions, -31 deletions) <details> <summary>View changed files</summary> 📝 `internal/database/database_test.go` (+30 -1) 📝 `internal/database/mysql.go` (+1 -1) 📝 `internal/database/pg.go` (+1 -1) 📝 `internal/database/sqlite.go` (+1 -1) 📝 `internal/webserver/handler-api-ext.go` (+16 -17) 📝 `internal/webserver/handler.go` (+6 -10) </details> ### 📄 Description - Modified the extension API to use the same save flow as the regular API, by generating the bookmark first and trying to archive it later. This will result in a stored bookmark even if the archiving fails. - Switched the session priority, now the header has more priority than the cookie, witch should be the default, since the webserver sends the cookie and the extension requires the session anyway. - Fixed the `DB.GetBookmark` method by handling the `sql.ErrNoRows` silently (since it already exposes a `bool`). Fixes #517 --- <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:58 +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#638
No description provided.