cms icon indicating copy to clipboard operation
cms copied to clipboard

bug: Bookmark duplicate bug & Bookmark State update bug

Open HarshK200 opened this issue 10 months ago • 1 comments

Description When creating a bookmark using the sidebar it doesn't update that state on the FolderView page and if you add bookmark on Folderview page after adding it on the sidebar it Creates two bookmarks for the same video

To Reproduce Steps to reproduce the behavior:

  1. Go to any course page and open any folder for e.g. week-1 in webdev
  2. Open the sidebar add a bookmark to any of the video in week-1
  3. ERR: notice how the adding a bookmark didn't reflect on the video card in the week-1 folderview
  4. Now click on the add bookmark on week-1 folderview video card.
  5. ERR: If you navigate to the bookmarks page now you'll find you have two bookmarks for the same video

Expected behavior On click on add bookmark on either the videoCard component or the sidebar they should both reflect the change and duplicate bookmark problem would be solved.

Screenshots or GIFs

https://github.com/user-attachments/assets/cd34ec37-818a-45ab-9995-90f3389de586

Info (please complete the following information):

  • Browser: both firefox and chrome
  • Version: [firefox: 136.0.2 (64-bit), chrome: 134.0.6998.117 (Official Build) (64-bit)]

Additional context The problem is because one component i.e. the FolderView is a server component whereas the sidebar is a client component, since there is no concept of state in between the both the way it works for when you do the steps to reproduce the other way around is because it re-validates the path on the server side for the folderView videoCard component. But it doesn't do that on the client-side for the sidebar

HarshK200 avatar Mar 27 '25 09:03 HarshK200

i originally thought of making the recoil state and store bookmarks accordingly and use it , but it still causes issue as the sidebar is client side and even tho the state gets updated doesn't seem to update the state on both ends . Let me know if you fix it or not

divu777 avatar Apr 02 '25 17:04 divu777