Skip to content

fix(conversationlist): avoid blocking main thread in onResume, causin… - #6684

Merged
mahibi merged 1 commit into
masterfrom
bugfix/noid/fixAnrInConvList
Sep 10, 2026
Merged

fix(conversationlist): avoid blocking main thread in onResume, causin…#6684
mahibi merged 1 commit into
masterfrom
bugfix/noid/fixAnrInConvList

Conversation

@mahibi

@mahibi mahibi commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator

…g ANR

blockingGet() on userManager.users in onResume() forced the main thread to wait on the SQLCipher connection pool, which background WorkManager jobs (CapabilitiesWorker, AccountRemovalWorker) were contending for at the same time, leading to an ANR. Fetch the account count asynchronously via lifecycleScope + await() instead.

The same blockingGet() pattern exists in several other places in this class and elsewhere touching the DB/network synchronously from the main thread; those are lower risk since they're not in the onResume hot path, but are worth revisiting if similar ANRs show up.

Assisted-by: Claude Code:claude-sonnet-5

🏁 Checklist

  • ⛑️ Tests (unit and/or integration) are included or not needed
  • 🔖 Capability is checked or not needed
  • 🔙 Backport requests are created or not needed: /backport to stable-xx.x
  • 📅 Milestone is set
  • 🌸 PR title is meaningful (if it should be in the changelog: is it meaningful to users?)

🤖 AI (if applicable)

  • The content of this PR was partly or fully generated using AI

…g ANR

blockingGet() on userManager.users in onResume() forced the main thread
to wait on the SQLCipher connection pool, which background WorkManager
jobs (CapabilitiesWorker, AccountRemovalWorker) were contending for at
the same time, leading to an ANR. Fetch the account count
asynchronously via lifecycleScope + await() instead.

The same blockingGet() pattern exists in several other places in this
class and elsewhere touching the DB/network synchronously from the
main thread; those are lower risk since they're not in the onResume
hot path, but are worth revisiting if similar ANRs show up.

Assisted-by: Claude Code:claude-sonnet-5

Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
@mahibi mahibi added this to the 25.1.0 milestone Sep 10, 2026
@mahibi mahibi self-assigned this Sep 10, 2026
@mahibi mahibi added the 3. to review Waiting for reviews label Sep 10, 2026
@mahibi

mahibi commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator Author

/backport to stable-25.0.x

@mahibi
mahibi merged commit d159cf3 into master Sep 10, 2026
17 of 20 checks passed
@mahibi
mahibi deleted the bugfix/noid/fixAnrInConvList branch September 10, 2026 09:13
@github-actions

Copy link
Copy Markdown
Contributor

APK file: https://github.com/nextcloud/talk-android/actions/runs/34458423628/artifacts/10144886063
To test this change/fix you can simply download above APK file and install and test it in parallel to your existing Nextcloud app.
qrcode (please click on link to get QR code displayed)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews AI assisted

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant