Skip to content

hotfix/cp-12672-anrs-on-app-start-cleverpushinit-does-database-and - #386

Merged
unnaticleverpush merged 3 commits into
masterfrom
hotfix/cp-12672-anrs-on-app-start-cleverpushinit-does-database-and
Oct 16, 2026
Merged

unnaticleverpush merged 3 commits into
masterfrom
hotfix/cp-12672-anrs-on-app-start-cleverpushinit-does-database-and

Conversation

@unnaticleverpush

@unnaticleverpush unnaticleverpush commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Fix main-thread disk access during SDK initialization


Summary by cubic

Moves SharedPreferences and database work off the main thread during SDK initialization to avoid ANRs on app start.

  • init() prepares and migrates SharedPreferences on a background executor, then resumes initialization on the main thread.
  • Retention cleanup runs on a dedicated database executor instead of the calling thread.
  • Keeps the synchronous path when initialization starts off the main thread.

Written for commit 6c8c992. Summary will update on new commits.

Review in cubic Turn on auto-fix

Fix main-thread disk access during SDK initialization
@unnaticleverpush unnaticleverpush self-assigned this Oct 7, 2026
Comment thread cleverpush/src/main/java/com/cleverpush/CleverPush.java
Comment thread cleverpush/src/main/java/com/cleverpush/CleverPush.java

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 1 file

Reply with feedback, questions, or to request a fix.

Turn on auto-fix | Re-trigger cubic

Comment thread cleverpush/src/main/java/com/cleverpush/CleverPush.java Outdated
Comment thread cleverpush/src/main/java/com/cleverpush/CleverPush.java
Comment thread cleverpush/src/main/java/com/cleverpush/CleverPush.java Outdated
Comment thread cleverpush/src/main/java/com/cleverpush/CleverPush.java Outdated
Comment thread cleverpush/src/main/java/com/cleverpush/CleverPush.java
@unnaticleverpush
unnaticleverpush merged commit cccfe11 into master Oct 16, 2026
4 of 5 checks passed
@unnaticleverpush
unnaticleverpush deleted the hotfix/cp-12672-anrs-on-app-start-cleverpushinit-does-database-and branch October 16, 2026 06:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants