v1.8.4: dual mode would have refused to start against a good core - #11
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
assertCoreRejectsAnonymousthrows on anything that is not a 401 — so the404 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:
The fix
The root cause was duplication, so the fix is de-duplication. The probe now
lives in
server/supertokens/coreProbe.jsand both callers import it. A testasserts 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
unverified) rather than throwing; thetenant-scoped path is found on a modern core; and both callers are asserted
to import the shared probe
🤖 Generated with Claude Code