Skip to content

Skip bookmarks for missing items instead of failing #580

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

Merged
merged 1 commit into from
May 27, 2025

Conversation

khers
Copy link
Contributor

@khers khers commented May 27, 2025

Currently if a bookmark exists for an item that does not exist in the db, either because it has been removed or it never did, the user is prevented from retrieving any bookmarks. We can be in this state if media has moved or been deleted, but also because the createBookmark endpoint does not verify the item id provided.

This patch makes the getBookmarks endpoint ignore bookmarks for missingitems.

Fixes: #578

@khers
Copy link
Contributor Author

khers commented May 27, 2025

I can also see cleaning the bookmarks for missing items at this point as well, happy to add that if it is the preferred solution.

Not returning them and not cleaning them means that this table can grow indefinitely.

@khers khers force-pushed the bookmark-missing-items branch from 7234203 to 2aa8e76 Compare May 27, 2025 22:03
Currently if a bookmark exists for an item that does not exist in the
db, either because it has been removed or it never did, the user is
prevented from retrieving any bookmarks. We can be in this state if
media has moved or been deleted, but also because the createBookmark
endpoint does not verify the item id provided.

This patch makes the getBookmarks endpoint ignore bookmarks for missing
items.

Fixes: sentriz#578

Signed-off-by: Eric B Munson <[email protected]>
@khers khers force-pushed the bookmark-missing-items branch from 2aa8e76 to 7bb04eb Compare May 27, 2025 22:04
@sentriz
Copy link
Owner

sentriz commented May 27, 2025

I can also see cleaning the bookmarks for missing items at this point as well, happy to add that if it is the preferred solution.

Not returning them and not cleaning them means that this table can grow indefinitely.

@khers makes sense, we could probably have some cleanBookmarks in the scanner
image

@sentriz sentriz merged commit cf02c62 into sentriz:master May 27, 2025
1 check passed
sentriz pushed a commit that referenced this pull request May 27, 2025
)

Currently if a bookmark exists for an item that does not exist in the
db, either because it has been removed or it never did, the user is
prevented from retrieving any bookmarks. We can be in this state if
media has moved or been deleted, but also because the createBookmark
endpoint does not verify the item id provided.

This patch makes the getBookmarks endpoint ignore bookmarks for missing
items.

Fixes: #578

Signed-off-by: Eric B Munson <[email protected]>
@sentriz
Copy link
Owner

sentriz commented May 27, 2025

thanks!

@khers
Copy link
Contributor Author

khers commented May 27, 2025

I can also see cleaning the bookmarks for missing items at this point as well, happy to add that if it is the preferred solution.
Not returning them and not cleaning them means that this table can grow indefinitely.

@khers makes sense, we could probably have some cleanBookmarks in the scanner image

I will look into this but it might take me a minute, totally new to go.

@khers khers deleted the bookmark-missing-items branch May 27, 2025 22:39
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.

createBookmark allows a user to create bookmark for invalid media ID.
2 participants