@3dsource/angular-unreal-module 0.0.146-dev.5 → 0.0.146-dev.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -3613,20 +3613,30 @@ class StreamAdoptionService {
|
|
|
3613
3613
|
* this in `takeUntil(abortEstablishingConnection)`, so a route change / teardown
|
|
3614
3614
|
* cancels it. Emits exactly once. Cancelling runs no adoption — which is what
|
|
3615
3615
|
* stops a fast route-switch from starting overlapping connections.
|
|
3616
|
+
*
|
|
3617
|
+
* Wrapped in `defer` so the `tryAdopt()` side effect (which dispatches
|
|
3618
|
+
* `streamAdopted`) runs at SUBSCRIPTION time, not when the observable is
|
|
3619
|
+
* built. The effect prepends `startWith(setEstablishingConnection(true))`,
|
|
3620
|
+
* which starts the telemetry session and subscribes its phase catalog; that
|
|
3621
|
+
* must happen BEFORE `streamAdopted` → `regionTelemetryOnAdopt$` replays
|
|
3622
|
+
* `regionResolved`, or the region phase fires into a session that doesn't
|
|
3623
|
+
* exist yet and is lost. `defer` guarantees that ordering.
|
|
3616
3624
|
*/
|
|
3617
3625
|
awaitAndAdopt$() {
|
|
3618
|
-
|
|
3619
|
-
|
|
3620
|
-
|
|
3621
|
-
|
|
3622
|
-
|
|
3623
|
-
|
|
3624
|
-
|
|
3625
|
-
|
|
3626
|
-
|
|
3627
|
-
|
|
3628
|
-
|
|
3629
|
-
|
|
3626
|
+
return defer(() => {
|
|
3627
|
+
const parked = window.__stream;
|
|
3628
|
+
if (!parked) {
|
|
3629
|
+
return of(false);
|
|
3630
|
+
}
|
|
3631
|
+
if (parked.state !== 'connecting') {
|
|
3632
|
+
return of(this.tryAdopt());
|
|
3633
|
+
}
|
|
3634
|
+
Logger.info('[Adoption] Prefetch in progress — waiting before connecting');
|
|
3635
|
+
return timer(0, ADOPT_POLL_MS).pipe(map$1(() => window.__stream?.state ?? 'failed'),
|
|
3636
|
+
// Keep polling while still connecting; the `true` (inclusive) emits the
|
|
3637
|
+
// settling value (`ready`/`failed`) that ends the wait.
|
|
3638
|
+
takeWhile((state) => state === 'connecting', true), last(), map$1(() => this.tryAdopt()));
|
|
3639
|
+
});
|
|
3630
3640
|
}
|
|
3631
3641
|
/**
|
|
3632
3642
|
* @returns `true` if a ready parked stream was adopted (caller must NOT
|
|
@@ -3647,7 +3657,7 @@ class StreamAdoptionService {
|
|
|
3647
3657
|
return false;
|
|
3648
3658
|
}
|
|
3649
3659
|
Logger.info('[Adoption] Adopting prefetched stream', parked.timings);
|
|
3650
|
-
//
|
|
3660
|
+
// Clear the script's timers and mark the handoff complete.
|
|
3651
3661
|
parked.adopt();
|
|
3652
3662
|
// Flag cirrus connected (so a later `initSignalling` won't open a 2nd
|
|
3653
3663
|
// connection), record the adopted machine, and hydrate the streamer info
|