mirror of
https://github.com/go-shiori/shiori.git
synced 2026-04-25 06:25:54 +03:00
[PR #500] [MERGED] fix: saving bookmarks inconsistencies #621
Labels
No labels
component:backend
component:builds
component:builds
component:extension
component:frontend
component:readability
database
database:mysql
database:postgres
database:sqlite
feature:ebooks
github_actions
good first issue
hacktoberfest
note:duplicate?
note:fixed?
note:out-of-scope?
os:windows
priority:high
priority:low
pull-request
resolution:as-intended
resolution:cant-reproduce
resolution:duplicate
resolution:fixed
resolution:wontfix
tag:TBD
tag:big-task
tag:help-wanted
tag:huge-data
tag:meta
tag:more-info
tag:next
tag:no-stale
tag:requires-migrations
tag:research
tag:security 🛡️
tag:stale
tag:waiting-for-assignee
type:bug
type:documentation
type:enhancement
type:meta
type:ux
user:cli
user:web
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/shiori#621
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/go-shiori/shiori/pull/500
Author: @fmartingr
Created: 10/11/2022
Status: ✅ Merged
Merged: 10/11/2022
Merged by: @fmartingr
Base:
master← Head:fix/database-save📝 Commits (10+)
b612236chore: updated go-migrate dependencies5624858fix: specify if we're saving bookmarks expecting a creationc4f44ccfix(api): using incorrect bookmark for content downlaoda5c11eetest(db): added test pipeline for databases6ce379cdev: added basic docker-compose for development3f7e384chore: uncommented tests135dc13ci(test): added mysql service165fc27typo6206cf9test(mysql): select database after reset5341d2dfix(mysql): ignore empty row errors when parsing tags📊 Changes
19 files changed (+384 additions, -82 deletions)
View changed files
📝
.github/workflows/_test.yml(+16 -0)➕
Dockerfile.compose(+6 -0)➕
docker-compose.yaml(+46 -0)📝
go.mod(+1 -1)📝
go.sum(+2 -2)📝
internal/cmd/add.go(+1 -1)📝
internal/cmd/import.go(+1 -1)📝
internal/cmd/pocket.go(+1 -1)📝
internal/cmd/update.go(+1 -1)📝
internal/database/database.go(+1 -1)➕
internal/database/database_test.go(+103 -0)📝
internal/database/mysql.go(+37 -22)➕
internal/database/mysql_test.go(+60 -0)📝
internal/database/pg.go(+18 -7)📝
internal/database/pg_test.go(+15 -23)📝
internal/database/sqlite.go(+28 -13)➕
internal/database/sqlite_test.go(+36 -0)📝
internal/webserver/handler-api-ext.go(+2 -2)📝
internal/webserver/handler-api.go(+9 -7)📄 Description
Saving bookmarks between engines had some inconsistencies regarding the insert/update mechanism used in shiori, and our latest changes fixing some postgresql issues (Introduced by
github.com/go-shiori/shiori@222fc14fe2andgithub.com/go-shiori/shiori@dc73cd825bas pointed out in #499) where causing problems in both SQLite and Mysql.DB.SaveBookmarksmethod, now requires aninsertparameter indicating that we were expecting to create a record.falsewill try to update a record. it would fail either case if the condition is not met.INSERTandUPDATEare split rather than handing conflict onINSERT, since PSQL was handling the URL field, SQLite the ID field and MySQL any failing constraint.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.