fix(#21): move DB I/O to Dispatchers.IO in AddEdit screen models #22

Merged
admin merged 1 commits from feat/21-move-db-io-to-dispatchers-io into main 2026-06-28 13:30:20 +00:00
Owner

Summary

  • Wrap Room calls in withContext(Dispatchers.IO) in AddEditExpenseScreenModel and AddEditRecurringScreenModel so DB I/O no longer runs on Dispatchers.Main.

Test plan

  • ./gradlew assembleDebug succeeds

Closes #21

## Summary - Wrap Room calls in `withContext(Dispatchers.IO)` in `AddEditExpenseScreenModel` and `AddEditRecurringScreenModel` so DB I/O no longer runs on `Dispatchers.Main`. ## Test plan - [ ] `./gradlew assembleDebug` succeeds Closes #21
admin added 1 commit 2026-06-28 13:28:50 +00:00
Wrap getExpenses.awaitOne, upsertExpense.await, getRecurringExpenses.awaitOne
and upsertRecurringExpense.await in withContext(Dispatchers.IO) { ... } so
the suspending Room calls run off the main thread. State-flow updates stay
inside screenModelScope.launch, which is Main-bound, and execute after the
withContext block returns.
admin merged commit ba99eac4be into main 2026-06-28 13:30:20 +00:00
admin deleted branch feat/21-move-db-io-to-dispatchers-io 2026-06-28 15:01:37 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: admin/ledgerr#22