Deliver Observable read values as microtasks instead of after a timer
Maintainer thường phản hồi trong vòng 3 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 74/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- angular, typescript
- Lĩnh vực
- api
Hướng nghiên cứu
Start with src/zones.ts:82 and the ɵzoneWrap path described in the issue; check how schedulers.insideAngular is used by the Observable wrappers. Add or update tests for the timing behavior, including a wrapped Subject and the affected compat streams. Done means values reach subscribers in a microtask after the current task, not synchronously or after a timer.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Version info
Angular: 22.2
Firebase: 12.19.0
AngularFire: 22.0.0-rc.0, and main
Description
Every Observable-returning read waits one timer turn before its subscriber sees a value:
ɵzoneWrappipes those reads (collectionData,docData,authState,user,objectVal,listVal,fromTask, the Remote Configget*Changesstreams, 34 wrappers across the modular modules including Firestore Lite) throughobserveOn(schedulers.insideAngular).- That scheduler is built over rxjs
asyncScheduler(src/zones.ts:82), which defers withsetInterval, so each value reaches the subscriber one macrotask after Firebase handed it over. - For Firestore that is a second timer: the SDK already hands each snapshot to its callback inside a
setTimeout(0). - The scheduler came in with #2243 (merged 2020), and the comment that PR added requires that emissions are never synchronous. rxjs's
AsapScheduler, which defers withPromise.resolve().then, meets that requirement and delivers at the next microtask checkpoint, before any timer.
The compat layer is affected:
- The
AngularFireAuthstreamsauthState,userandcredentialdeliver through the same scheduler instance and inherit whichever timing it has. AngularFireFunctionsandAngularFireMessaginguse it only to hand over the SDK instance before their work starts, so their results are not delivered through it.- Compat Database and Firestore deliver through
schedulers.outsideAngularand are not part of this.
How to reproduce these conditions
On a fresh Angular 22.2 app with @angular/fire@next, wrap a Subject with the real ɵzoneWrap, subscribe, and at the moment the source emits register a setTimeout(0) and a queueMicrotask:
- When the subscriber runs, the timer has already fired, in a zone.js app and a zoneless one, in Chrome and Firefox.
- The real
collectionDataagainst the Firestore emulator and the compatauthStateagainst the Auth emulator behave the same way in Chrome. - With an
AsapSchedulerin place ofasyncScheduler, the microtask has fired and the timer has not, in every one of those runs.
Expected behavior
A value Firebase produced is handed to the subscriber as soon as the current task finishes, without an extra timer turn.
Actual behavior
Every value waits for a setInterval callback.
- Ngôn ngữ chính
- TypeScript
- Star
- 7.8k
- Fork
- 2.2k
- Merge trung bình
- 2 ngày 12 giờ
- Pull request đã merge (30 ngày)
- 24
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- 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 angular/angularfire
-
Document the 22.0.0-rc.1 changesCó thể đã có người làm @armando-navarro đã nhận 3 ngày trước. Đang mởcomp: docs type: chore
Độ khó 3/5 Nửa ngày Mức phù hợp với người mới 18/100
angular/angularfire#3834 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Accept firebase 13 in @angular/fire 22Có thể đã có người làm @armando-navarro đã nhận 4 ngày trước. Đang mởcomp: core comp: schematics type: feature
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
angular/angularfire#3830 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
`ɵzoneWrap` ignores a handler passed as an observer object, and holds a wrapped promise forever once its injector is destroyedCó thể đã có người làm @armando-navarro đã nhận 4 ngày trước. Đang mởcomp: app-check comp: core comp: firestore comp: remote-config comp: zones type: bug version: current (v17+)
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
angular/angularfire#3828 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Eleven wrapped callbacks and remote-config `isSupported` hold the app unstable until something that may never happenCó thể đã có người làm @armando-navarro đã nhận 5 ngày trước. Đang mởcomp: app-check comp: core comp: database comp: remote-config comp: ssr comp: zones type: bug version: current (v17+)
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
angular/angularfire#3826 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
comp: compat comp: firestore comp: storage type: chore
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
angular/angularfire#3822 ·
Maintainer thường phản hồi trong vòng 3 ngày
Tất cả issue của angular/angularfire
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
riverqueue/river#1576 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[bug] A prompt queued during a run is assessed without its textCó thể đã có người làm @jwiegley đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
DevMortimer/pi-warden#211 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 84/100
mattermost/compass-design#191 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Add unit tests for the organization admin role checkCó thể đã có người làm @SaffuSafwan đã nhận hôm nay. Đang mởarea/core good first issue help wanted
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
elmohq/elmo#1095 · 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 62/100
HorusGoul/trizum#559 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày