Android icon indicating copy to clipboard operation
Android copied to clipboard

[Bug] Application not responding while in middle of importing large number of bookmarks

Open pfaron opened this issue 3 years ago • 5 comments

Describe the bug

DuckDuckGo stops responding while in the middle of importing 50000 bookmarks. Choosing to not terminate the process makes DDG close the Bookmarks view after a while. After restarting the app (reentering the Bookmarks view), only fraction of bookmarks are correctly imported (for emulated Pixel 5 usually around 9000 imported sites, for Xiaomi Mi Note 10 Lite 18000 the first try and 33000 the second try).

On emulated Pixel 5 it also doesn't properly import 10000 bookmarks most of the times.

How to Reproduce

  1. Generate an html file with tens of thousands of bookmarks.
  2. Open the app, open the browser menu and open the Bookmarks view.
  3. Try importing the file via the import function in Bookmarks.

App stopped responding while importing: DDG_ANR25

The html file content:

<!DOCTYPE NETSCAPE-Bookmark-file-1> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8"> <Title>Bookmarks</Title> <H1>Bookmarks</H1> <DL><p> <DT><H3 ADD_DATE="1618844074" LAST_MODIFIED="1618844074" PERSONAL_TOOLBAR_FOLDER="true">DuckDuckGo Bookmarks</H3> <DL><p> <DT><A HREF="https://myanimelist.net/manga/1/" ADD_DATE="1618844074" LAST_MODIFIED="1618844074">Manga number 1</A> <DT><A HREF="https://myanimelist.net/manga/2/" ADD_DATE="1618844074" LAST_MODIFIED="1618844074">Manga number 2</A> [...] <DT><A HREF="https://myanimelist.net/manga/49999/" ADD_DATE="1618844074" LAST_MODIFIED="1618844074">Manga number 49999</A> </DL><p> </DL><p>

Expected behavior

The bookmarks would be correctly imported.

Environment

- DDG App Version: 5.107.0
- Device: Pixel 5
- OS: Android 11.0
and
- DDG App Version: 5.105.1
- Device: Xiaomi Mi Note 10 Lite
- OS: Android 11.0

pfaron avatar Jan 19 '22 19:01 pfaron

It is the duplicate of #1677

ShivanshGoel221B avatar Jan 24 '22 05:01 ShivanshGoel221B

@pfaron can you provide (if possible) us a file where we can test this?

cmonfortep avatar Feb 25 '22 17:02 cmonfortep

Yes, of course! I create the html files using a very basic java program. The html file structure is similar to DDG auto generated html file when exporting bookmarks. Here I provide files with 10000, 50000 and 100000 bookmarks.

duckduckgobookmarks10000.html.txt duckduckgobookmarks50000.html.txt duckduckgobookmarks100000.html.txt Main.java.txt

(Sorry, but I don't really know how to attach files with .html and .java extension, so you will have to change extensions yourselves).

pfaron avatar Mar 05 '22 11:03 pfaron

related: https://github.com/duckduckgo/Android/pull/1987

cmonfortep avatar Jul 07 '22 09:07 cmonfortep

I was just testing this out and could not reproduce an ANR (tested on an API 29 and API 34 emulator with the above sample 100,000 bookmark import).

alenz316 avatar Mar 30 '24 20:03 alenz316