Repository navigation
Remote Config and Installations support on BoM 34.18.0 (#70) - #74
Merged
Merged
Conversation
… Storage request without swallowing cancellation
… in tests, and keep FirebaseAppTest data in its temporary folder
…rebase initializes with it
…failures on every OS
…, and terminate Firestore after its test
Merges angelix's feature/remote-config on top of the auth integration branch. Conflicts: the README table keeps the 34.18.0 versions with the Remote Config and Installations rows no longer struck through; FirebasePlatform.getFilesDir keeps the branch's <tmpdir>/firebase-files default, and the Context.filesDir #72 added gives way to the branch's, which also creates the folder. Fix-ups for firebase-common 22, which keeps its heartbeats in a preferences DataStore rather than SharedPreferences: HeartBeatTest reads the stored heartbeat back through JavaDataStorage from the datastore folder, and JavaDataStorage URL-encodes its file name like the Context file APIs do, as the name carries the app id whose ':' Windows rejects.
There was a problem hiding this comment.
🟡 Changes recommended
Clearing an unread preferences file can report success without removing persisted values, allowing them to return after restart.
2 open issues
What changed in this PR
Enables the bundled Remote Config and Installations libraries on the JVM with BoM 34.18.0, building on the Auth integration and adapting heartbeat storage to firebase-common 22.
Changes:
- Adds Android compatibility shims, component registration, and file-backed preferences.
- Updates file storage defaults and encodes heartbeat filenames for Windows compatibility.
- Adds integration and persistence tests, improves test isolation, and documents storage requirements.
| File | Description |
|---|---|
| src/test/kotlin/PreferencesFileTest.kt | Tests preference persistence, types, concurrency, and write failures. |
| src/test/kotlin/JsonReaderTest.kt | Tests parsing Installations responses. |
| src/test/kotlin/HeartBeatTest.kt | Checks heartbeat persistence through DataStore. |
| src/test/kotlin/FirebaseTest.kt | Provides isolated storage and thread-safe test state. |
| src/test/kotlin/FirebaseStorageTest.kt | Replaces a download-task assertion with a path assertion. |
| src/test/kotlin/FirebaseRemoteConfigTest.kt | Tests Remote Config APIs and live fetching. |
| src/test/kotlin/FirebasePlatformTest.kt | Checks default storage paths. |
| src/test/kotlin/FirebaseFirestoreTest.kt | Terminates Firestore after tests. |
| src/test/kotlin/FirebaseAppTest.kt | Tests data collection settings and plain Context initialization. |
| src/test/kotlin/fakes/FakeFirebasePlatform.kt | Adds thread-safe storage, log capture, and configurable file paths. |
| src/test/kotlin/DateUtilsTest.kt | Tests elapsed-time formatting. |
| src/test/kotlin/ContextFilesTest.kt | Tests file APIs and preference storage. |
| src/main/java/com/google/firebase/FirebasePlatform.kt | Defaults file storage to a dedicated temporary folder. |
| src/main/java/com/google/firebase/datastorage/JavaDataStorage.kt | URL-encodes DataStore filenames. |
| src/main/java/com/android/internal/util/StringPool.java | Adds string pooling for the JSON reader. |
| src/main/java/android/util/MalformedJsonException.java | Adds the JSON parsing exception. |
| src/main/java/android/util/JsonToken.java | Adds JSON token definitions. |
| src/main/java/android/util/JsonScope.java | Adds JSON parser scope definitions. |
| src/main/java/android/util/JsonReader.java | Ports Android’s streaming JSON reader. |
| src/main/java/android/util/Base64DataException.java | Adds the exception needed by Base64 streams. |
| src/main/java/android/text/format/DateUtils.java | Formats Remote Config throttle durations. |
| src/main/java/android/net/TrafficStats.java | Adds no-op network accounting methods. |
| src/main/java/android/content/SharedPreferences.java | Expands preference types and editor operations. |
| src/main/java/android/content/res/Resources.java | Exposes resource configuration. |
| src/main/java/android/content/res/Configuration.java | Supplies the default locale. |
| src/main/java/android/content/PreferencesFile.kt | Implements JSON-backed preferences with atomic writes. |
| src/main/java/android/content/pm/PackageManager.java | Registers Remote Config and A/B testing components. |
| src/main/java/android/content/Context.kt | Adds file APIs, persistent preferences, and Application context support. |
| README.md | Documents product support and storage configuration. |
| build.gradle.kts | Cleans isolated test data before execution. |
Review effort: Balanced
…g limitations footnote Clearing a preferences file as its first operation skipped the load, so storedValues was still empty, the unchanged check passed and the file kept its values for the next start. The README row keeps its footnote reference, which the merge had dropped.
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.


Integration branch for #70 by angelix, which makes the bundled Remote Config and Installations libraries work on the JVM, carried onto the BoM 34.18.0 master (now Remote Config 23.1.0 and Installations 19.1.2). It is based on #73, the auth integration, because the two touch the same build script and
FirebasePlatform; retarget it tomasteronce #73 merges, and it then shows only #70's commits unchanged plus one merge commit with the resolution and fix-ups.Conflict resolution: the README table keeps the 34.18.0 versions with the Remote Config and Installations rows no longer struck through;
FirebasePlatform.getFilesDirkeeps the branch's<tmpdir>/firebase-filesdefault (a folder of its own is better than the bare temp directory #72 defaulted to), and theContext.filesDir#72 added gives way to the branch's, which also creates the folder.Two fix-ups for firebase-common 22, which keeps its heartbeats in a preferences DataStore rather than the SharedPreferences the branch was written against:
HeartBeatTestreads the stored heartbeat back throughJavaDataStoragefrom thedatastorefolder instead of ashared_prefsfile. The branch's file-backed SharedPreferences stay, as Remote Config and Installations use them.JavaDataStorageURL-encodes its file name like the branch's Context file APIs do, as the name carries the app id, whose:Windows rejects.The full suite passes under the emulator: 81 tests (the original 12, the auth PRs' 22 and #70's 47, including the live
fetchAndActivateagainst thefir-java-sdkproject). Supersedes #70, which can be closed once this merges, with the author credited by the commits.