Skip to content

Conversation

@Ethran
Copy link
Owner

@Ethran Ethran commented Feb 7, 2026

Introduces an optional "Allow destructive migrations" setting to handle SQLiteBlobTooBigException errors during stroke data re-encoding.

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.
Copy link
Contributor

Copilot AI left a 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 destructiveMigrations in AppSettings and surfaces it as a toggle in Debug Settings.
  • Updates stroke re-encoding migration logic to optionally delete oversized stroke_old rows 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
Copy link

Copilot AI Feb 7, 2026

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 = ...)).

Suggested change
import kotlinx.coroutines.channels.BufferOverflow

Copilot uses AI. Check for mistakes.
Ethran and others added 3 commits February 7, 2026 16:28
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@Ethran Ethran merged commit 54da639 into main Feb 7, 2026
1 check passed
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.

1 participant