Skip to content

[Bug] The deleted bookmark folder is still accessible and sometimes lead to crash #5671

@Kobayashi-996

Description

@Kobayashi-996

Describe the bug

I found that a bookmark folder was still accessible for a while after it was deleted. And this operation would sometimes lead to crash with exception like "

FATAL EXCEPTION: main
Process: com.duckduckgo.mobile.android.debug, PID: 21320
java.lang.ArrayIndexOutOfBoundsException: length=10; index=-1
at java.util.ArrayList.get(ArrayList.java:439)
at com.duckduckgo.savedsites.impl.bookmarks.BookmarkItemTouchHelperCallback.updateDragHandle(BookmarkItemTouchHelperCallback.kt:75)
at com.duckduckgo.savedsites.impl.bookmarks.BookmarkItemTouchHelperCallback.clearView(BookmarkItemTouchHelperCallback.kt:63)
at androidx.recyclerview.widget.ItemTouchHelper$3.onAnimationEnd(ItemTouchHelper.java:653)
at android.animation.Animator$AnimatorListener.onAnimationEnd(Animator.java:552)
at android.animation.ValueAnimator.endAnimation(ValueAnimator.java:1232)
at android.animation.ValueAnimator.doAnimationFrame(ValueAnimator.java:1474)
at android.animation.AnimationHandler.doAnimationFrame(AnimationHandler.java:146)
at android.animation.AnimationHandler.access$100(AnimationHandler.java:37)
at android.animation.AnimationHandler$1.doFrame(AnimationHandler.java:54)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:947)
at android.view.Choreographer.doCallbacks(Choreographer.java:761)
at android.view.Choreographer.doFrame(Choreographer.java:693)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:935)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6669)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)

"

How to Reproduce

  1. Enter the app
  2. More Options
  3. Bookmarks
  4. Create a Parent folder
  5. Enter the Parent folder
  6. Create a Child folder
  7. Delete the Child folder
  8. Go to Search (will find all the Parent folder and the Child folder are all accessible)
  9. Enter the Parent folder (will find the Child folder is still there)
  10. Enter the Child folder (this step sometimes lead to the adforementioned crash)
  11. You can still do anything you want in the deleted Child folder
Screen_recording_20250220_193736.mp4

Expected behavior

Although there is a short period for undo, I think the deleted folder should not be accesible at the time, or this would cause many potential problem.

Environment

- DDG App Version: 5.225.0
- Device: Pixel 8 pro
- OS: Android 13

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions