Skip to content

fix: enforce the FableLoom hosted-session HTTPS gate under the test runner (#5670) - #5807

Merged
atomantic merged 1 commit into
mainfrom
claim/issue-5670
Sep 2, 2026
Merged

fix: enforce the FableLoom hosted-session HTTPS gate under the test runner (#5670)#5807
atomantic merged 1 commit into
mainfrom
claim/issue-5670

Conversation

@atomantic

Copy link
Copy Markdown
Owner

Summary

checkHostedSessionReadiness forced its HTTPS posture to "enabled" whenever NODE_ENV === 'test' — a test-only hack in production code that made the one preflight check actually blocking a hosted FableLoom play session unreachable from the suite. The behavior that matters ("HTTPS off ⇒ startHostedSession throws 412 HOSTED_SESSION_PREFLIGHT_FAILED") had never been pinned by a test and could regress silently. The same line also computed an httpsEnabled binding that nothing in the file read.

  • Removed the dead httpsEnabled binding.
  • isHttps now reads the real network posture only: netStatus.scheme === 'https'.
  • Tests mock getNetworkExposureStatus instead, matching how the rest of the server treats that dependency.
  • server/sockets/fableLoomHosted.test.js gets the same TLS-provisioned snapshot, since it drives the real createHostedSession.

Every other readiness check (start scene, STT, TTS, playback) and the join-URL host resolution are untouched.

Test plan

New coverage in server/services/fableLoom/hostedSession.test.js:

  • HTTPS on ⇒ ready: true, https.enabled: true, https.url starts https://, checks.https.ok.
  • HTTPS off (scheme: 'http') ⇒ ready: false, checks.https.ok: false, and errors contains the HTTPS is required… message.
  • HTTPS off ⇒ createHostedSession rejects with status: 412 / code: 'HOSTED_SESSION_PREFLIGHT_FAILED' — the regression this uniquely catches, which was impossible to fail before because the gate was disarmed under the runner.

Verified the two new tests fail against the pre-fix source and pass after. cd server && npm test is green (37,264 passed; the one flaky routes/imageGen.multipart.test.js beforeAll hook timeout under full-suite load passes on its own re-run and is unrelated to this change).

Acceptance criteria from the issue: grep -n "NODE_ENV" server/services/fableLoom/hostedSession.js returns nothing, and httpsEnabled no longer appears in the file.

Closes #5670

https://claude.ai/code/session_01GMxEz43s3YCLaVZV9KmVwE

…unner (#5670)

checkHostedSessionReadiness forced its HTTPS posture to "enabled" whenever
NODE_ENV === 'test', so the one preflight check that actually blocks a hosted
play session was unreachable from the suite: an HTTP-only install refusing to
start a session with a 412 HOSTED_SESSION_PREFLIGHT_FAILED had never been
pinned by a test and could regress silently. The same line also computed an
httpsEnabled binding that nothing read.

Drop both NODE_ENV escape hatches and the dead binding, and mock
getNetworkExposureStatus in the tests instead — matching how the rest of the
server treats that dependency. New coverage pins the HTTPS-on green path, the
HTTPS-off readiness error, and the 412 refusal from createHostedSession; the
socket-namespace suite gets the same TLS-provisioned snapshot because it
drives the real createHostedSession.

Claude-Session: https://claude.ai/code/session_01GMxEz43s3YCLaVZV9KmVwE
@atomantic
atomantic merged commit 9ee34b5 into main Sep 2, 2026
7 checks passed
@atomantic
atomantic deleted the claim/issue-5670 branch September 2, 2026 05:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FableLoom hosted-session preflight disables its HTTPS gate under NODE_ENV=test and computes a dead variable

1 participant