[PR #965] feat: Sync API #898

Open
opened 2026-02-25 23:35:49 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/go-shiori/shiori/pull/965
Author: @Monirzadeh
Created: 8/17/2024
Status: 🔄 Open

Base: masterHead: sync


📝 Commits (10+)

  • 8cd9b33 just return bookmarks after specific timestamp
  • 89bea5b send modified and deleted item in database
  • caac394 make swagger
  • b3abc95 Merge branch 'master' into sync
  • 939b6cc pagginate for sync request
  • 7412ca3 make swagger
  • 8e70402 if ids be empty than just return modified bookmarks
  • ed0926c show deletd bookmark once and just in first page
  • 3b73f02 update filter for LastSync and deleted function for postgress
  • 760c920 test autentication for sync endpoint

📊 Changes

10 files changed (+685 additions, -1 deletions)

View changed files

📝 docs/swagger/docs.go (+84 -0)
📝 docs/swagger/swagger.json (+84 -0)
📝 docs/swagger/swagger.yaml (+56 -0)
📝 internal/database/database.go (+5 -0)
📝 internal/database/database_test.go (+44 -0)
📝 internal/database/mysql.go (+48 -0)
📝 internal/database/pg.go (+49 -0)
📝 internal/database/sqlite.go (+50 -1)
📝 internal/http/routes/api/v1/bookmarks.go (+108 -0)
📝 internal/http/routes/api/v1/bookmarks_test.go (+157 -0)

📄 Description

This PR is trying to add sync functionality to shiori.
This API get last sync and list of id in client side as return deleted item and modified item from last sync.

This PR did sync without need to store deleted time, so close #903.

TODO:

  • get modified item
  • get deleted item list
  • add pagination to the response
  • show deleted item just in first page to avoid unneeded query on database
  • done for postgress
  • done for mariadb
  • unittest
    • authentication test
    • 0 or negative id
    • return correct bookmark for specific timestamp
    • empty id if deleted not set
    • return correct id that not exist on database
    • deleted ID return correct id from databases
      this todolist can be update overtime

We have bellow problems in CI:


🔄 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/965 **Author:** [@Monirzadeh](https://github.com/Monirzadeh) **Created:** 8/17/2024 **Status:** 🔄 Open **Base:** `master` ← **Head:** `sync` --- ### 📝 Commits (10+) - [`8cd9b33`](https://github.com/go-shiori/shiori/commit/8cd9b33906b674c0694768ec8f0a339289e8e731) just return bookmarks after specific timestamp - [`89bea5b`](https://github.com/go-shiori/shiori/commit/89bea5b04104d6ed0335eb361073e8fe4b922a59) send modified and deleted item in database - [`caac394`](https://github.com/go-shiori/shiori/commit/caac394239cf4d5133184f88fb2d3dd6ec4b432f) make swagger - [`b3abc95`](https://github.com/go-shiori/shiori/commit/b3abc95819b0f7aae2ddee8282fbf5192c6a376a) Merge branch 'master' into sync - [`939b6cc`](https://github.com/go-shiori/shiori/commit/939b6cc2136f63f7ff7cc76415215501727bc186) pagginate for sync request - [`7412ca3`](https://github.com/go-shiori/shiori/commit/7412ca372ab2615426d7c9464650ada6aa4808b5) make swagger - [`8e70402`](https://github.com/go-shiori/shiori/commit/8e70402bb636a644d3b810a3dbd873768845a317) if ids be empty than just return modified bookmarks - [`ed0926c`](https://github.com/go-shiori/shiori/commit/ed0926c9e5b27efe5b366f417ccdb3c800277678) show deletd bookmark once and just in first page - [`3b73f02`](https://github.com/go-shiori/shiori/commit/3b73f02f6774bb55e14fc8ea6f08debbf59cf1ff) update filter for LastSync and deleted function for postgress - [`760c920`](https://github.com/go-shiori/shiori/commit/760c9204561b6735d56fbeb3673f97005b63b637) test autentication for sync endpoint ### 📊 Changes **10 files changed** (+685 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `docs/swagger/docs.go` (+84 -0) 📝 `docs/swagger/swagger.json` (+84 -0) 📝 `docs/swagger/swagger.yaml` (+56 -0) 📝 `internal/database/database.go` (+5 -0) 📝 `internal/database/database_test.go` (+44 -0) 📝 `internal/database/mysql.go` (+48 -0) 📝 `internal/database/pg.go` (+49 -0) 📝 `internal/database/sqlite.go` (+50 -1) 📝 `internal/http/routes/api/v1/bookmarks.go` (+108 -0) 📝 `internal/http/routes/api/v1/bookmarks_test.go` (+157 -0) </details> ### 📄 Description This PR is trying to add sync functionality to shiori. This API get last sync and list of id in client side as return deleted item and modified item from last sync. This PR did sync without need to store deleted time, so close #903. #### TODO: - [x] get modified item - [x] get deleted item list - [x] add pagination to the response - [x] show deleted item just in first page to avoid unneeded query on database - [x] done for postgress - [x] done for mariadb - [x] unittest - [x] authentication test - [x] 0 or negative id - [x] return correct bookmark for specific timestamp - [x] empty id if deleted not set - [x] return correct id that not exist on database - [x] deleted ID return correct id from databases *this todolist can be update overtime* #### We have bellow problems in CI: - https://github.com/go-shiori/shiori/pull/965/commits/33f91a24199f56f86c4c8b83129750c43521a819 pass without mariadb database? is it possible api unittest not run on mariadb? - https://github.com/go-shiori/shiori/pull/965/commits/92307dc344bbdba70645c5fb4d1e1e9b3d80d46a pass on windows macos and openbsd? those should field too because mariadb should field anyway. dose we run database mariadb test on all os or those tests just on linux for mariadb? - postgress and mariadb tests run in CI just under Linux OS --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
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#898
No description provided.