| ... | ... | @@ -13,7 +13,6 @@ import * as Stream from "effect/Stream"; |
| 13 | 13 | import * as ServerConfig from "./config.ts"; |
| 14 | 14 | import * as OrchestrationEngine from "./orchestration/Services/OrchestrationEngine.ts"; |
| 15 | 15 | import * as ProjectionSnapshotQuery from "./orchestration/Services/ProjectionSnapshotQuery.ts"; |
| 16 | | import * as AnalyticsService from "./telemetry/AnalyticsService.ts"; |
| 17 | 16 | import * as ServerRuntimeStartup from "./serverRuntimeStartup.ts"; |
| 18 | 17 | import * as GitVcsDriver from "./vcs/GitVcsDriver.ts"; |
| 19 | 18 | |
| ... | ... | @@ -103,56 +102,6 @@ it.effect("enqueueCommand fails queued work when readiness fails", () => |
| 103 | 102 | ), |
| 104 | 103 | ); |
| 105 | 104 | |
| 106 | | it.effect("launchStartupHeartbeat does not block the caller while counts are loading", () => |
| 107 | | Effect.scoped( |
| 108 | | Effect.gen(function* () { |
| 109 | | const releaseCounts = yield* Deferred.make<void, never>(); |
| 110 | | const countsStarted = yield* Deferred.make<void, never>(); |
| 111 | | |
| 112 | | yield* ServerRuntimeStartup.launchStartupHeartbeat.pipe( |
| 113 | | Effect.provideService(ProjectionSnapshotQuery.ProjectionSnapshotQuery, { |
| 114 | | getUserInputActivity: () => Effect.die("unused"), |
| 115 | | getCommandReadModel: () => Effect.die("unused"), |
| 116 | | getSnapshot: () => Effect.die("unused"), |
| 117 | | getShellSnapshot: () => Effect.die("unused"), |
| 118 | | getArchivedShellSnapshot: () => Effect.die("unused"), |
| 119 | | getSnapshotSequence: () => Effect.die("unused"), |
| 120 | | getEventReplayStats: () => Effect.die("unused"), |
| 121 | | getCounts: () => |
| 122 | | Deferred.succeed(countsStarted, undefined).pipe( |
| 123 | | Effect.andThen(Deferred.await(releaseCounts)), |
| 124 | | Effect.as({ |
| 125 | | projectCount: 2, |
| 126 | | threadCount: 3, |
| 127 | | }), |
| 128 | | ), |
| 129 | | getActiveProjectByWorkspaceRoot: () => Effect.succeed(Option.none()), |
| 130 | | getProjectShellById: () => Effect.succeed(Option.none()), |
| 131 | | getFirstActiveThreadIdByProjectId: () => Effect.succeed(Option.none()), |
| 132 | | getThreadCheckpointContext: () => Effect.succeed(Option.none()), |
| 133 | | getFullThreadDiffContext: () => Effect.succeed(Option.none()), |
| 134 | | getThreadRuntimeContext: () => Effect.die("unused"), |
| 135 | | getThreadShellById: () => Effect.succeed(Option.none()), |
| 136 | | getThreadDetailById: () => Effect.succeed(Option.none()), |
| 137 | | getThreadDetailSnapshot: () => Effect.succeed(Option.none()), |
| 138 | | searchThreads: () => Effect.succeed({ matches: [] }), |
| 139 | | }), |
| 140 | | Effect.provideService(AnalyticsService.AnalyticsService, { |
| 141 | | record: () => Effect.void, |
| 142 | | flush: Effect.void, |
| 143 | | }), |
| 144 | | ); |
| 145 | | |
| 146 | | // The heartbeat is forked, so the caller is already back here while |
| 147 | | // getCounts is still parked. Awaiting countsStarted proves the forked |
| 148 | | // work really ran; releaseCounts staying incomplete proves the caller |
| 149 | | // never waited for it. |
| 150 | | yield* Deferred.await(countsStarted); |
| 151 | | assert.equal(yield* Deferred.isDone(releaseCounts), false); |
| 152 | | }), |
| 153 | | ), |
| 154 | | ); |
| 155 | | |
| 156 | 105 | it.effect("resolveWelcomeBase derives cwd and project name from server config", () => |
| 157 | 106 | Effect.gen(function* () { |
| 158 | 107 | const welcome = yield* ServerRuntimeStartup.resolveWelcomeBase.pipe( |