-
-
Notifications
You must be signed in to change notification settings - Fork 22
Add destructive migration option for oversized strokes #205
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Introduces an optional "Allow destructive migrations" setting to handle `SQLiteBlobTooBigException` errors during stroke data re-encoding. --AI-- When this setting is enabled, if a stroke is too large to be migrated even with a batch size of 1, it will be deleted to allow the migration to proceed. If disabled (the default), the migration will halt, and a message will be displayed prompting the user to enable the option in the Debug Settings. - Added `destructiveMigrations` flag to `AppSettings`. - Implemented logic in `StrokeReencoding` to delete oversized rows when the flag is set. - Added a toggle for this option in the Debug Settings UI.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Adds a user-controllable “Allow destructive migrations” setting to handle SQLiteBlobTooBigException during the runtime stroke re-encoding/backfill, with a fallback that can delete oversized legacy rows when enabled.
Changes:
- Introduces
destructiveMigrationsinAppSettingsand surfaces it as a toggle in Debug Settings. - Updates stroke re-encoding migration logic to optionally delete oversized
stroke_oldrows when batch size reduction can’t proceed. - Adds delayed snackbar emission helper and additional migration logging/snack messages.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| app/src/main/java/com/ethran/notable/ui/views/Settings.kt | Adds Debug Settings toggle for destructive migrations. |
| app/src/main/java/com/ethran/notable/ui/SnackBar.kt | Adds a coroutine import (currently unused). |
| app/src/main/java/com/ethran/notable/data/db/StrokeReencoding.kt | Implements destructive fallback behavior + helper functions for snackbar emission and deletion. |
| app/src/main/java/com/ethran/notable/data/datastore/AppSettings.kt | Adds destructiveMigrations setting to persisted app settings. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| import kotlinx.coroutines.CoroutineScope | ||
| import kotlinx.coroutines.Dispatchers | ||
| import kotlinx.coroutines.NonCancellable | ||
| import kotlinx.coroutines.channels.BufferOverflow |
Copilot
AI
Feb 7, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BufferOverflow is imported but not used anywhere in this file; Kotlin treats unused imports as a compile error. Remove the import or update the code to use it (e.g., configure MutableSharedFlow(..., onBufferOverflow = ...)).
| import kotlinx.coroutines.channels.BufferOverflow |
app/src/main/java/com/ethran/notable/data/db/StrokeReencoding.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/com/ethran/notable/data/db/StrokeReencoding.kt
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Introduces an optional "Allow destructive migrations" setting to handle
SQLiteBlobTooBigExceptionerrors during stroke data re-encoding.