Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): Antigravity limits no longer show old readings after a failed probe #34389

Openmths-mcfs(GitHub profile, opens in a new tab)wants to merge 16 commits intomain fromrefs/pull/34389/headopened View on GitHub

Showing 3 changed files with 126 additions and 64 deletions.

x
0 of 3 viewed, 3 left
108 additions and 54 deletionsapps/server/src/provider/AntigravityProvider.test.tsModified
View file
@@ -13,6 +13,7 @@
import * as Effect from "effect/Effect";
import * as Fiber from "effect/Fiber";
import * as Layer from "effect/Layer";
+import * as Option from "effect/Option";
import * as Ref from "effect/Ref";
import * as Schema from "effect/Schema";
import * as Stream from "effect/Stream";
@@ -172,10 +173,15 @@
Effect.andThen(initialUpdate),
Effect.asVoid,
- // Subscribe before the trigger; yield the returned pull to await the publish.
+ // Subscribes now, before the trigger runs (a pull would subscribe only when first pulled);
+ // yield the returned effect to await the publish.
const nextPublish = (predicate: (snapshot: ServerProvider) => boolean) =>
- Stream.toPull(provider.snapshot.streamChanges.pipe(Stream.filter(predicate))).pipe(
- Effect.map((pull) => pull.pipe(Effect.map((snapshots) => snapshots[0]))),
+ provider.snapshot.streamChanges.pipe(
+ Stream.filter(predicate),
+ Stream.runHead,
+ Effect.map(Option.getOrUndefined),
+ Effect.forkChild({ startImmediately: true }),
+ Effect.map(Fiber.join),
return {
provider,
@@ -715,59 +721,107 @@