[Remote Config] Real-time listener stops receiving updates, with no onError, when the stream starts during a persisted backoff
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 78/100
Hướng nghiên cứu
Đọc ConfigRealtimeHttpClient.beginRealtimeHttpStream() và đường dẫn thử lại mà hàm này gọi khi backoff đã lưu đang hoạt động. Xác nhận cờ kết nối đang chạy ảnh hưởng thế nào đến canMakeHttpStreamConnection(), sau đó kiểm tra các bài kiểm thử luồng thời gian thực Remote Config hiện có có bao phủ đường dẫn đó hay không. Hoàn tất khi luồng thử lại sau khi backoff kết thúc và listener có thể nhận cập nhật.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
[READ] Step 1: Are you in the right place?
Yes, this is a bug in firebase-config in this repository.
[REQUIRED] Step 2: Describe your environment
- Android Studio version: **Android Studio Quail 4 | 2026.1.4
- Firebase Component: Remote Config (real-time updates,
addOnConfigUpdateListener) - Component version: 23.1.0
[REQUIRED] Step 3: Describe the problem
The app stops receiving Remote Config updates for as long as the process lives. Once this happens, a registered ConfigUpdateListener never fires again: values changed in the console never reach the app, and onError is never called, so the app can't detect or recover from it. Only killing the process brings updates back.
On Android a process can stay alive for days, so apps that rely on real-time updates (rather than frequent fetch() calls) keep running on stale config for that whole time. In our app, users stayed on old values for days.
When it happens: two conditions, in this order.
- A stream connection fails while the app is in the foreground. This means no network, or the server answering 408, 429, 502, 503 or 504. The SDK then persists a backoff end time in SharedPreferences. The backoff is about 2 minutes after the first failure (randomized ±50%) and doubles with each consecutive failure, up to 256 minutes. It survives process restarts and is cleared only by the next successful (200) connection.
- Before that backoff ends, the SDK starts the stream again. It does this whenever the app calls
addOnConfigUpdateListener(for example on a cold start) or comes back to the foreground. Both go throughstartHttpConnection()→beginRealtimeHttpStream(), which hits the backoff early return described below and leaves the stream stuck.
Both are routine. For example, the user opens the app on a flaky connection, switches away, and comes back a minute later. From then on the app receives no updates until the process is killed.
Steps to reproduce:
- Register a
ConfigUpdateListenerwith the app in the foreground. - Make the real-time stream connection fail while the app is in the foreground. Keep the app in the foreground until the attempt fails.
- Restore network access, kill the app, and relaunch it while the backoff is still in effect. Register the listener again.
- After the backoff end time has passed, publish a Remote Config change.
Expected: when the backoff ends, the stream reconnects and the listener receives the update.
Actual: no connection is attempted after the backoff ends, the listener receives nothing, and onError is never called.
Relevant Code:
In ConfigRealtimeHttpClient.beginRealtimeHttpStream(), the method sets isHttpConnectionRunning up front. The early return for an active backoff never clears it, because only the finally block of the connection task clears it:
public void beginRealtimeHttpStream() {
if (!checkAndSetHttpConnectionFlagIfNotRunning()) { // sets isHttpConnectionRunning = true
return;
}
ConfigSharedPrefsClient.RealtimeBackoffMetadata backoffMetadata =
sharedPrefsClient.getRealtimeBackoffMetadata();
Date currentTime = new Date(clock.currentTimeMillis());
if (currentTime.before(backoffMetadata.getBackoffEndTime())) {
// No connection was opened, but isHttpConnectionRunning is still true here.
// The retry below goes through canMakeHttpStreamConnection(), which requires
// !isHttpConnectionRunning, so it is silently dropped and the stream stays stopped.
retryHttpConnectionWhenBackoffEnds();
return;
}
// ...
}
Suggested fix: release the flag before scheduling the retry, since no connection was opened on this path:
setIsHttpConnectionRunning(false);
retryHttpConnectionWhenBackoffEnds();
return;
- Ngôn ngữ chính
- Java
- Star
- 2.6k
- Fork
- 733
- Merge trung bình
- 2 ngày 15 giờ
- Pull request đã merge (30 ngày)
- 72
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của firebase/firebase-android-sdk
-
Crashlytics plugin writes build ID lists in directory listing order, so APKs can differ between machinesCó thể đã có người làm @mrober đã nhận 8 ngày trước. Đang mởapi: crashlytics
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
firebase/firebase-android-sdk#8789 · 1 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
api: auth
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
firebase/firebase-android-sdk#8505 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 15/100
firebase/firebase-android-sdk#8835 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
firebase/firebase-android-sdk#8832 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Firestore: NoSuchElementException in SQLiteIndexManager.encodeValues for a != query with a trailing orderBy when cache index auto-creation is enabledCó thể đã có người làm @dconeybe đã nhận 2 ngày trước. Đang mởapi: firestore
firebase/firebase-android-sdk#8831 · 1 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của firebase/firebase-android-sdk
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
NationalSecurityAgency/ghidra#10220 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
Maintainer thường phản hồi trong vòng 1 ngày
-
RIS export splits an organization name containing “and” into multiple authorsCó thể đã có người làm @Gautam-aman đã nhận hôm nay. Đang mởstatus: needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
JabRef/jabref#17821 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
FailureContext.java rounds down thresholds in lastedAtLeast()Có thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày