You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Disconnect from Remote Config real-time server when app is backgrounded. (#6816)
This PR focuses on enhancing the reliability and efficiency of the
Remote Config real-time stream, particularly concerning background app
states. We've refined the ``ConfigRealtimeHttpClient`` to retrieve and
manage the underlying input and error streams more effectively, ensuring
proper closure even in error scenarios. Additionally, the
``closeRealtimeHttpStream`` method now explicitly closes these streams
using the acquired references.
A key improvement is the robust handling of the app's background state.
The ``setRealtimeBackgroundState`` method is now synchronized to
guarantee thread-safe updates and will immediately close the real-time
HTTP connection when the app transitions to the background. This
background state is also reflected in ``ConfigAutoFetch``, allowing for
conditional exception logging during real-time stream listening,
ensuring logs are only generated when the app is actively in the
foreground. Furthermore, ``ConfigAutoFetch`` now maintains a dedicated
``InputStream`` reference to ensure proper stream closure, and a
separate reference is kept in ``beginRealtimeHttpStream`` to handle
potential early closure scenarios before ``ConfigAutoFetch`` is reached.
Copy file name to clipboardExpand all lines: firebase-config/CHANGELOG.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,6 @@
1
1
# Unreleased
2
-
2
+
[fixed] Fixed an issue where the connection to the real-time Remote Config backend could remain
3
+
open in the background.
3
4
4
5
# 22.1.0
5
6
*[feature] Added support for custom signal targeting in Remote Config. Use `setCustomSignals` API for setting custom signals and use them to build custom targeting conditions in Remote Config.
0 commit comments