Droid-ify / Droid-ify/client

[BUG] There are potential time-consuming operations on the UI thread.

Open
#1,349 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
Kotlin
Stars
7.4k
Forks
214
PR merge metrics
No merged PRs in 30d

Description

### Before you submit

- [x] I have searched the issue tracker for [open](https://github.com/Droid-ify/client/issues) and [closed](https://github.com/Droid-ify/client/issues?q=is%3Aissue+is%3Aclosed) issues that are similar to the feature request I want to file, without success.
- [x] This issue contains only one bug.

### What's going wrong?

Hello,

We used a static analysis tool to check whether Droid-ifyperforms any potentially time-consuming operations on the UI thread. Our analysis identified the following potential issues:

In Droidify.kt, within the onCreate() method, the API call forceSyncAll() involves a database query or write. SQL operations performed on the main thread can block when the dataset grows. According to Android best practices, such operations should be moved off the UI thread and executed in a background thread or coroutine.

In Droidify.kt, within the listenApplications() method, the operation involves a database query or write. SQL operations performed on the main thread can block when the dataset grows. According to Android best practices, such operations should be moved off the UI thread and executed in a background thread or coroutine.

We hope this report helps improve responsiveness and user experience.

### How do we reproduce it?

_No response_

### What did you expect?

_No response_

### Screenshots

_No response_

### Your phone

Pixel 9a

### Android version

SDK 37

### Droid-ify version

The code in the master branch

### Anything else?

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.