Open Bug 2032600 Opened 2 months ago Updated 1 month ago

Unify bookmark-saving logic into AddBookmarksUseCase (remove duplication across BrowserToolbarMiddleware and MenuDialogMiddleware)

Categories

(Firefox for Android :: Bookmarks, enhancement)

All
Android
enhancement

Tracking

()

People

(Reporter: fmasalha, Unassigned)

References

Details

(Whiteboard: [fxdroid] [group1])

As discussed in https://github.com/mozilla-firefox/firefox/pull/33#issuecomment-3783446096 and flagged again in https://github.com/mozilla-firefox/firefox/pull/215, the bookmark-saving logic (including LastSavedFolderCache handling and parentGuid resolution) is duplicated across at least two places:

  • BrowserToolbarMiddleware.kt (line ~504)
  • MenuDialogMiddleware.kt (lines 265-280)

The proposed fix is:

  1. Move LastSavedFolderCache into the bookmarks package
  2. Add it as a parameter to AddBookmarksUseCase
  3. Move the bookmark-saving/folder-cache logic into the use-case
  4. Remove the duplicate logic in BrowserToolbarMiddleware and MenuDialogMiddleware (and any other places)
  5. Update tests accordingly

This was flagged by @segunfamisa as a follow-up to the import bookmarks feature work.

Whiteboard: [fxdroid] [group1]

I think this is becoming important for us to fix. There have been multiple reports of last saved folder not working appropriately, and I believe it's because we keep missing other entry points to bookmarks saving.

See Also: → 2035313
Duplicate of this bug: 2032506
You need to log in before you can comment on or make changes to this bug.