Repository navigation
fix: resolve "Not in Wikidata" errors for valid verbs (#598, #738) - #742
Open
prince-0408 wants to merge 2 commits into
Open
prince-0408 wants to merge 2 commits into
prince-0408 wants to merge 2 commits into
Conversation
prince-0408
requested review from
Roniscend,
andrewtavis and
angrezichatterbox
October 28, 2026 07:48
Roniscend
suggested changes
Oct 28, 2026
| private lateinit var db: SQLiteDatabase | ||
| private lateinit var manager: ConjugateDataManager | ||
|
|
||
| private val sampleContract = |
Collaborator
There was a problem hiding this comment.
When a verb column is missing the complex form parsing now returns just the auxiliary, like have instead of an empty string which would show wrong conjugations. The new fallback also changes what the Conjugate app search returns and the tests only use mocks so they never check the SQL or the actual fix.
Collaborator
Author
There was a problem hiding this comment.
Thanks for the review @Roniscend! Addressed in the latest commit!
… test against real SQLite - Return empty string immediately in parseComplexFormFromRow if the verb column is missing or empty, avoiding displaying standalone auxiliaries like 'have'. - Remove the getLanguageDatabase fallback in DatabaseFileManager.getConjugateDatabase to prevent unintentional query scope pollution in Conjugate app search. - Replace MockK cursor stubs with Robolectric in-memory SQLite tables to verify actual SQL queries and schema behaviors.
Member
Collaborator
|
yes it does, looks good to me @andrewtavis ! |
Member
|
Thanks, @ashb155! I'll look into scribe-org/Scribe-Data#725 and then we can redeploy Scribe-Server and finalize this one. @angrezichatterbox, would be good for you to also take a look once the Scribe-Data/Scribe-Server processes are finalized :) |
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.
Description
This PR resolves #598 ("Conjugate command returns 'Not in Wikidata' for valid verbs") and #738 ("Redundant sequential SQLite file opens and identical SELECT queries").
Root Causes
DatabaseFileManager: When keyboard users download their language packages, the data is saved in${language}LanguageData.sqlite(which includes theverbstable). However,ConjugateDataManagerexclusively queriedgetConjugateDatabase(), which looked only for${language}ConjugateData.sqlite(downloaded only in the Conjugate standalone app). Since the file didn't exist for keyboard users,getConjugateDatabase()returnednull, failing all valid verbs with"Not in Wikidata".getVerbCursor()usedWHERE $columnName = ?on only the infinitive column. Any uppercase or mixed-case verb (e.g. German capitalized forms, or uppercase typing), inflected verb form (e.g. typing"went"or"running"), or verbs with common grammatical prefixes ("to ","se ","sich ","s'") immediately failed.getTheConjugateLabelslooped across every single tense and form (up to 120 iterations per verb), opening and closing the database file sequentially on every call. Additionally,parseComplexForminvokedgetConjugateDatabase()without closing the database connection.Key Changes
DatabaseFileManager.kt):getLanguageDatabase()when${language}ConjugateData.sqliteis absent..uppercase()to prevent filesystem casing mismatches on Linux/Android ext4 filesystems.ConjugateDataManager.kt):LOWER(${SqlIdentifier.quote(col)}) = LOWER(?)."to ","se ","sich ", and"s'".verbstable columns if direct infinitive matching yields no results.parseComplexFormFromRow), eliminating database connection leaks.getStructuredConjugations()to efficiently serve UI screens.SQLiteExtensions.kt):getTableColumns()helper withSqlIdentifiervalidation and quoting.ConjugationSelectionScreen.kt):manager.getStructuredConjugations()to load forms in a single pass.rememberSaveableforselectedTenseGroupto survive device rotations and fold/unfold events.ConjugateDataManagerTest.kt):HABEN->haben), prefix-stripping (to walk->walk), inflected form lookups (went->go), and missing database handling.CHANGELOG.mdunder Bug Fixes.Closes #598
Closes #738