Fix SQLiteException crash in MIGRATION_5_6 from unescaped apostrophes - #699
Merged
Merged
Conversation
MIGRATION_5_6 built its Phrase_New/Category_New INSERT statements via raw string interpolation, so an apostrophe in user-generated text (e.g. "I'm hungry") broke out of the SQL string literal and threw SQLiteException inside Room's onUpgrade -- blocking the database, and the app, from ever opening for affected users. Switched both inserts to parameterized queries. Closes #698 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
troymyree-lang
requested review from
Michael Gonzalez (MicGon7) and
dlucci-wt
as code owners
September 1, 2026 13:43
troymyree-lang
deleted the
feature/698/fix-migration-5-6-sql-injection
branch
September 1, 2026 13:58
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Ticket
Closes #698
Type of Change
Testing
New instrumented test (
migrate5to6_preservesApostropheInUserGeneratedTextinMigrationTest.kt) wasn't run against a device/emulator locally (none available in this environment) -- it will run via Firebase Test Lab in CI along with the rest ofandroidTest.compileDebugKotlin,compileDebugAndroidTestKotlin, andtestDebug(all JVM unit tests) verified passing locally.Checklist
./gradlew testDebug)