Fix two live bugs: delete AppDatabase and singleton-ify API service #7

Merged
fredo merged 1 commit from feature/refactor-2-quick-fixes into main 2026-09-12 18:27:15 +02:00
Owner
  • Delete AppDatabase.kt: same DB file name as MedicationDatabase but
    declares schema v1 with no migrations — any future call would throw
    on a user's device with their notes inside.

  • Make MedicationApiService a process-wide singleton via getInstance().
    Multiple MedicationRepository instances (ViewModel, UpdateWorker,
    activity.recreate()) were each building their own OkHttp Cache over
    the same directory, which is explicitly unsupported and leaks on
    every language switch.

Co-Authored-By: Claude Sonnet 4.6 noreply@anthropic.com

- Delete AppDatabase.kt: same DB file name as MedicationDatabase but declares schema v1 with no migrations — any future call would throw on a user's device with their notes inside. - Make MedicationApiService a process-wide singleton via getInstance(). Multiple MedicationRepository instances (ViewModel, UpdateWorker, activity.recreate()) were each building their own OkHttp Cache over the same directory, which is explicitly unsupported and leaks on every language switch. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Delete AppDatabase.kt: same DB file name as MedicationDatabase but
  declares schema v1 with no migrations — any future call would throw
  on a user's device with their notes inside.

- Make MedicationApiService a process-wide singleton via getInstance().
  Multiple MedicationRepository instances (ViewModel, UpdateWorker,
  activity.recreate()) were each building their own OkHttp Cache over
  the same directory, which is explicitly unsupported and leaks on
  every language switch.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
fredo merged commit eabac3062a into main 2026-09-12 18:27:15 +02:00
fredo deleted branch feature/refactor-2-quick-fixes 2026-09-12 20:31:00 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
fredo/Compendium!7
No description provided.