Skip to content

Remote Config and Installations support on BoM 34.18.0 (#70) - #74

Merged
nbransby merged 35 commits into
masterfrom
integrate-remote-config
Oct 26, 2026
Merged

nbransby merged 35 commits into
masterfrom
integrate-remote-config

Conversation

@nbransby

@nbransby nbransby commented Oct 26, 2026 •

Copy link
Copy Markdown
Member

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 to master once #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.getFilesDir keeps the branch's <tmpdir>/firebase-files default (a folder of its own is better than the bare temp directory #72 defaulted to), and the Context.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:

  • HeartBeatTest reads the stored heartbeat back through JavaDataStorage from the datastore folder instead of a shared_prefs file. The branch's file-backed SharedPreferences stay, as Remote Config and Installations use them.
  • JavaDataStorage URL-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 fetchAndActivate against the fir-java-sdk project). Supersedes #70, which can be closed once this merges, with the author credited by the commits.

angelix added 30 commits October 7, 2026 20:22
… Storage request without swallowing cancellation
… in tests, and keep FirebaseAppTest data in its temporary folder
angelix and others added 4 commits October 8, 2026 11:09
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.
Copilot AI balanced review requested due to automatic review settings October 26, 2026 11:07

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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

Comment thread src/main/java/android/content/PreferencesFile.kt Outdated
Comment thread README.md Outdated
…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.
Base automatically changed from integrate-auth to master October 26, 2026 13:00
@nbransby
nbransby merged commit 0ca533c into master Oct 26, 2026
1 check passed
@nbransby
nbransby deleted the integrate-remote-config branch October 26, 2026 13:00
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.

3 participants