Skip to content

v1.8.4: dual mode would have refused to start against a good core - #11

Merged
NeverEndingCode merged 1 commit into
mainfrom
fix-boot-probe-404
Aug 8, 2026
Merged

v1.8.4: dual mode would have refused to start against a good core#11
NeverEndingCode merged 1 commit into
mainfrom
fix-boot-probe-404

Conversation

@NeverEndingCode

Copy link
Copy Markdown
Owner

Caught with the deployment one step away from AUTH_MODE=dual.

v1.8.3 fixed the wrong-endpoint probe in the preflight and left a second
copy of it in the boot path. That copy still used /recipe/users/count,
which SuperTokens core 12 does not implement, and
assertCoreRejectsAnonymous throws on anything that is not a 401 — so the
404 would have been read as "the core is running without API_KEYS" and stopped
the container from starting.

In the preflight the same bug printed an alarming line. Here it would have
blocked the cutover outright and blamed the operator for a URL this code got
wrong — against a core the preflight had just confirmed answers 401
correctly:

[PASS] core requires authentication  anonymous request rejected (401)

The fix

The root cause was duplication, so the fix is de-duplication. The probe now
lives in server/supertokens/coreProbe.js and both callers import it. A test
asserts exactly that — neither file may hardcode a probe path of its own —
because "remember to update both" is precisely what failed here.

The boot guard also narrows when it throws. Only a confirmed-open core is
fatal
: a known endpoint answering an unkeyed request with 200. A 404, an
unexpected status, or an unreachable core all warn and let the boot proceed. A
guard on the startup path should refuse only on evidence, never on the absence
of it.

Verification

  • 662 tests SQLite / 688 Postgres, 39 smoke assertions
  • New regressions: all-404 boots (unverified) rather than throwing; the
    tenant-scoped path is found on a modern core; and both callers are asserted
    to import the shared probe

🤖 Generated with Claude Code

v1.8.3 fixed the wrong-endpoint probe in the preflight and left a second copy
of it in the boot path. That copy still used /recipe/users/count, which
SuperTokens core 12 does not implement, and assertCoreRejectsAnonymous throws
on anything that is not a 401 - so the 404 would have been read as "the core is
running without API_KEYS" and stopped the container.

In the preflight that bug printed an alarming line. Here it would have blocked
the cutover outright and blamed the operator for a URL this code got wrong.
Caught while the owner's deployment was one step away from AUTH_MODE=dual, on a
core that the preflight had just confirmed answers 401 correctly.

The root cause was duplication, so the fix is de-duplication: the probe now
lives in server/supertokens/coreProbe.js and both callers import it. A test
asserts that - neither file may hardcode a probe path of its own - because
"remember to update both" is exactly what failed here.

The boot guard also narrows when it throws. Only a confirmed-open core is fatal
now: a known endpoint answering an unkeyed request with 200. A 404, an
unexpected status, or an unreachable core all warn and let the boot proceed. A
guard on the startup path should refuse only on evidence, never on the absence
of it.

662 tests green on SQLite, 688 on Postgres, 39 smoke assertions.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@NeverEndingCode
NeverEndingCode merged commit aa74d1e into main Aug 8, 2026
4 checks passed
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.

1 participant