From ae80d5c02df6545f2946e3301827a3fbfdfd4279 Mon Sep 17 00:00:00 2001 From: Brandon Thomas Date: Wed, 10 Jan 2024 03:38:47 -0500 Subject: [PATCH] clear out bookmark token if soft deleted (recommended by victor) --- .../user_bookmarks/batch_get_user_bookmarks_handler.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/crates/service/web/storyteller_web/src/http_server/endpoints/user_bookmarks/batch_get_user_bookmarks_handler.rs b/crates/service/web/storyteller_web/src/http_server/endpoints/user_bookmarks/batch_get_user_bookmarks_handler.rs index 845e98359f..212d5b4e36 100644 --- a/crates/service/web/storyteller_web/src/http_server/endpoints/user_bookmarks/batch_get_user_bookmarks_handler.rs +++ b/crates/service/web/storyteller_web/src/http_server/endpoints/user_bookmarks/batch_get_user_bookmarks_handler.rs @@ -53,6 +53,9 @@ pub struct BookmarkRow { /// Whether the entity is bookmarked or not pub is_bookmarked: bool, /// If the object is bookmarked, this is the bookmark token (used to delete the bookmark). + /// Since we soft-delete bookmarks, we go to the extra step of clearing out this field if + /// the bookmark is soft deleted, even though it still has a record with token on the + /// backend. pub maybe_bookmark_token: Option, } @@ -168,11 +171,14 @@ fn fill_in_missed_bookmarks(request_tokens: &HashSet, db_response: Vec