Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Sync API #965

Open
wants to merge 24 commits into
base: master
Choose a base branch
from
Open

feat: Sync API #965

wants to merge 24 commits into from

Conversation

Monirzadeh
Copy link
Collaborator

@Monirzadeh Monirzadeh commented Aug 17, 2024

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:

  • 33f91a2 pass without mariadb database? is it possible api unittest not run on mariadb?
  • 92307dc 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

@Monirzadeh Monirzadeh self-assigned this Sep 16, 2024
@Monirzadeh
Copy link
Collaborator Author

Monirzadeh commented Sep 24, 2024

Finally sync API :)
I am trying to do that without keeping deleted ids in database (we can change that if we see performance issue in long term)
Do we need any specific option in sync api like user can customize sort of modified bookmarks? or any other option?
Do we need more unit test (see We have bellow problems in CI section in first post of issue)?

I am not sure that using timestamp is the best option, but I am trying to choose safest option right now until we find better solution to handle time in database.

@Monirzadeh
Copy link
Collaborator Author

Thanks @DesarrolloAntonio it seems this PR has a bug that return empty imgURL for bookmarks.
it because of the way shiori detect state of files in server. i should find the best solution to fix this that i prefer that shiori save status of file(archive, ebook,image,etc) on database too
we need refactor some logic of shiori.
@fmartingr what do you think? any other solution do you prefer?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant