duckduckgo / Android

DuckDuckGo Android App
https://play.google.com/store/apps/details?id=com.duckduckgo.mobile.android
Apache License 2.0
3.76k stars 888 forks source link

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

Open pfaron opened 2 years ago

pfaron commented 2 years ago

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
ShivanshGoel221B commented 2 years ago

It is the duplicate of #1677

cmonfortep commented 2 years ago

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

pfaron commented 2 years ago

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).

cmonfortep commented 2 years ago

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

alenz316 commented 5 months ago

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).