-
-
Notifications
You must be signed in to change notification settings - Fork 150
Description
This issue respects the following points:
- I have read the FAQ
- I have searched for existing issues
- The issue affects the Notes Android app, neither the Notes server app nor the Nextcloud Android app.
Describe the bug
Description
In SingleNoteWidget.kt, it performs synchronous Room database queries on the main thread.
This happens inside the onReceive() → updateAppWidget() → getSingleNoteWidgetData() call chain.
Where the issue occurs
onReceive() runs on the main/UI thread.
onReceive() calls updateAppWidget, and inside updateAppWidget it calls getSingleNoteWidgetData. getSingleNoteWidgetData() is a blocking Room query, and since it is executed directly in onReceive(), it blocks the main thread.
What Android recommends
According to official guidelines:
Disk I/O and DB queries must not run on the main thread.
BroadcastReceiver should do only lightweight work.
Heavy work should be moved to a background thread (Executor / Coroutine / WorkManager).
Expected behavior
Move the database read into a background thread.
Notes Android version
4.5.2
Notes server version
4.5.2
Nextcloud Android version
4.5.2
Nextcloud version
4.5.2
Device
Android Emulator
Android Version
Android Version: 13 (API 33)
App Store
- Google Play Store
- F-Droid
- Huawei App Gallery
Stacktrace
No response