| ... | ... | @@ -61,7 +61,7 @@ const makeHarness = Effect.fn("makeAuthTestHarness")(function* ( |
| 61 | 61 | } = {}, |
| 62 | 62 | ) { |
| 63 | 63 | const authenticated = yield* Deferred.make<void, AcpErrors.AcpError>(); |
| 64 | | const discovered = yield* Deferred.make<void>(); |
| 64 | const discovered = yield* Deferred.make<void, AcpErrors.AcpError>(); |
| 65 | 65 | const closed = yield* Deferred.make<void>(); |
| 66 | 66 | const events: string[] = []; |
| 67 | 67 | let receiveAuthorizationUrl: |
| ... | ... | @@ -224,6 +224,33 @@ it.layer(NodeServices.layer)("AntigravityAuth", (it) => { |
| 224 | 224 | }), |
| 225 | 225 | ); |
| 226 | 226 | |
| 227 | it.effect( |
| 228 | "distinguishes a post-authentication session failure without exposing its payload", |
| 229 | () => |
| 230 | Effect.gen(function* () { |
| 231 | const harness = yield* makeHarness(); |
| 232 | yield* harness.auth.controller.start(owner); |
| 233 | yield* phase(harness.auth, "waiting"); |
| 234 | yield* Deferred.succeed(harness.authenticated, undefined); |
| 235 | yield* Deferred.fail( |
| 236 | harness.discovered, |
| 237 | new AcpErrors.AcpRequestError({ |
| 238 | code: -32603, |
| 239 | errorMessage: `Internal error ${callbackUrl}`, |
| 240 | method: "session/new", |
| 241 | }), |
| 242 | ); |
| 243 | const failed = yield* phase(harness.auth, "failed"); |
| 244 | assert.equal( |
| 245 | failed.message, |
| 246 | "Antigravity authenticated, but could not initialize a session or load models.", |
| 247 | ); |
| 248 | assert.isNull(failed.authorizationUrl); |
| 249 | assert.deepEqual(harness.catalog(), ["previous-account-model"]); |
| 250 | yield* Deferred.await(harness.closed); |
| 251 | }), |
| 252 | ); |
| 253 | |
| 227 | 254 | it.effect("does not call callback HTTP success a successful Google sign-in", () => |
| 228 | 255 | Effect.gen(function* () { |
| 229 | 256 | const harness = yield* makeHarness(); |