duckduckgo / duckduckgo/Android

[Bug] ANRs Persist in Database Without Expiry

Open
#5,009 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug needs triage
Dominant language
Kotlin
Stars
4.8k
Forks
1.4k
Avg merge
2d 17h
Merged PRs (30d)
170

Description

Describe the bug

ANR (Application Not Responding) reports are stored in the database, and while the most recent one is sent to the backend and removed, older ANRs that exist within the 3-hour window may remain in the database indefinitely. This could cause outdated ANRs to persist without proper cleanup, affecting app performance and database management.

How to Reproduce
  1. Trigger multiple ANRs within the app.
  2. The most recent ANR is sent to the backend and removed from the database.
  3. ANRs older than the most recent one remain stored.
  4. After 3 hours, observe that older ANRs are still in the database.
Expected behavior

The ANRs should either be cleared from the database after a set time window (3 hours in this case) or there should be a mechanism to regularly purge outdated ANRs to prevent them from persisting unnecessarily.
We can use DatabaseCleanupObserver

Environment
All app versions.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating DatabaseCleanupObserver and the code that stores and removes ANR reports. Trace how the three-hour window is applied, then verify that older reports are purged rather than left indefinitely, using the reproduction steps to confirm the cleanup behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, kotlin
Domain
database, mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.