duckduckgo / duckduckgo/Android
[Bug] The deleted bookmark folder is still accessible and sometimes lead to crash
Nobody has claimed this yet.
- Dominant language
- Kotlin
- Stars
- 4.8k
- Forks
- 1.4k
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 170
Description
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
- Enter the app
- More Options
- Bookmarks
- Create a Parent folder
- Enter the Parent folder
- Create a Child folder
- Delete the Child folder
- Go to Search (will find all the Parent folder and the Child folder are all accessible)
- Enter the Parent folder (will find the Child folder is still there)
- Enter the Child folder (this step sometimes lead to the adforementioned crash)
- You can still do anything you want in the deleted Child folder
https://github.com/user-attachments/assets/e6e775da-46c0-45f9-a55f-334c5ddb1c35
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with saved-sites bookmark deletion and navigation, then inspect BookmarkItemTouchHelperCallback.kt at updateDragHandle (line 75) and clearView (line 63), as shown in the crash. Reproduce the parent/child deletion flow and verify that the deleted child is no longer accessible after deletion and that the crash no longer occurs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- kotlin
- Domain
- mobile-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100