Repository navigation
Conversation
This branch has not been deployed
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.
Fixes #1991.
Opening a database whose version is newer than the app schema currently rejects with a
NullPointerExceptionon the legacy Android SQLite bridge in Release builds. The constructor setslogtonullwhen debug logging is disabled, butisCompatible()callslog.info()unconditionally in its newer-database branch.Guard that diagnostic call with
if (log != null), matching the existing guard inunsafeResetDatabase(), so the method reaches its existingNeedsSetupresult. Add a changelog entry and four Android instrumentation regression tests:The native test app uses
testBuildType "debug". The regression tests set the driver's logger to null through reflection to reproduce the Release state, and invoke the private compatibility check without widening the production API. Each test uses a real, isolated SQLite database. The null-logger downgrade test also checks that classification alone leaves the existing row intact.Validation
Ran the exact new instrumentation test class on an Android API 34 arm64 emulator using an isolated Gradle harness that compiles the upstream Java driver/SQLite implementation and the committed test file. The harness omits the React Native application/JS bundle:
newerDatabaseWithNullLoggerNeedsSetupthrowsNullPointerExceptionatLogger.info().OK (4 tests).git diff --checkpasses.The complete React Native bridge integration suite and
yarn ci:checkwere not run locally. The new tests live in the existingnative/androidTestinstrumentation source set for the Android CI job.Downgrade behavior
The existing
NeedsSetuppolicy is unchanged: opening a newer database proceeds to destructive schema setup. This patch fixes the unintended logging exception; it does not implement a data-preserving downgrade or make schema-changing OTA rollback safe. Applications must still protect unsynced local data.The C++ JSI and iOS implementations are unchanged. Related setup/reset-error work in #1981 and #1983 does not modify this compatibility branch.