Residual from the review of #14613. Non-blocking, cleanup.
After #14613, src/platform/auth/session/useSessionCookie.ts:85 reads:
const usesFirebaseToken = isCloud || useFirebaseToken
All three public entry points (ensureSessionCookie at :136, createSession at :141, createSessionOrThrow at :150) open with if (!isCloud) return, so establishSession is unreachable off Cloud. That makes usesFirebaseToken unconditionally true on every reachable path, which in turn makes the single-flight join condition inert:
if (
inFlightCreateSession?.ownerUid === ownerUid &&
(!usesFirebaseToken || inFlightCreateSession.usesFirebaseToken)
) {
Both disjuncts are constant true, so the condition reduces to the ownerUid match. The useFirebaseToken parameter threaded through establishSession/performCreateSession/getSessionHeaderOrThrow, the usesFirebaseToken field on InFlightCreateSession at :7, and the authStore.getAuthHeader() fallback at :54-58 are all now vestigial.
Consequence: the assertion expect(mockGetAuthHeader).not.toHaveBeenCalled() in useSessionCookie.test.ts:221 tests a branch no build can execute, so it reads as coverage while providing none.
Either delete the dead plumbing, or, if the weak-credential path is meant to come back, restore a reachable caller for it. Note the ADR-0011 invariant 4 property the original test protected (a strict creation must never inherit a weaker request's credential) is currently unenforceable either way.
Thread: #14613 (comment)
Residual from the review of #14613. Non-blocking, cleanup.
After #14613,
src/platform/auth/session/useSessionCookie.ts:85reads:All three public entry points (
ensureSessionCookieat:136,createSessionat:141,createSessionOrThrowat:150) open withif (!isCloud) return, soestablishSessionis unreachable off Cloud. That makesusesFirebaseTokenunconditionally true on every reachable path, which in turn makes the single-flight join condition inert:Both disjuncts are constant true, so the condition reduces to the
ownerUidmatch. TheuseFirebaseTokenparameter threaded throughestablishSession/performCreateSession/getSessionHeaderOrThrow, theusesFirebaseTokenfield onInFlightCreateSessionat:7, and theauthStore.getAuthHeader()fallback at:54-58are all now vestigial.Consequence: the assertion
expect(mockGetAuthHeader).not.toHaveBeenCalled()inuseSessionCookie.test.ts:221tests a branch no build can execute, so it reads as coverage while providing none.Either delete the dead plumbing, or, if the weak-credential path is meant to come back, restore a reachable caller for it. Note the ADR-0011 invariant 4 property the original test protected (a strict creation must never inherit a weaker request's credential) is currently unenforceable either way.
Thread: #14613 (comment)