Skip to content

Conversation

@TimoPtr
Copy link
Member

@TimoPtr TimoPtr commented Jan 5, 2026

Summary

Remove the need of AppDatabase.getInstance and removing the synchronization block from it. It might help reduce some ANR.

Checklist

  • New or updated tests have been added to cover the changes following the testing guidelines.
  • The code follows the project's code style and best_practices.
  • The changes have been thoroughly tested, and edge cases have been considered.
  • Changes are backward compatible whenever feasible. Any breaking changes are documented in the changelog for users and/or in the code for developers depending on the relevance.

Any other notes

Closes #5702

@TimoPtr TimoPtr requested a review from jpelgrom January 5, 2026 13:57
Copy link
Member

@jpelgrom jpelgrom left a comment

Choose a reason for hiding this comment

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

Sometimes you're using val dao = ..., sometimes it is val sensorDao = ... (example). Try to be consistent. My preference would be to use a specific name (sensorDao), reducing changed lines, or at least use the specific name if any other DAO is accessed in the same file to prevent mixups.

@TimoPtr TimoPtr requested a review from jpelgrom January 7, 2026 17:40
@jpelgrom jpelgrom linked an issue Jan 7, 2026 that may be closed by this pull request
Base automatically changed from feature/cleanup_app_database to main January 14, 2026 10:28
@TimoPtr TimoPtr enabled auto-merge (squash) January 14, 2026 14:35
@TimoPtr TimoPtr merged commit 2b2ece8 into main Jan 14, 2026
22 checks passed
@TimoPtr TimoPtr deleted the feature/remove_appdatabase_get-instance branch January 14, 2026 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Avoid AppDatabase.getInstance to be use outside of Hilt

3 participants