Skip to content

Fix: stop register-super failing against a running app (fixes #123) - #124

Merged
taylortom merged 1 commit into
masterfrom
fix-register-super-probe
Aug 14, 2026
Merged

Fix: stop register-super failing against a running app (fixes #123)#124
taylortom merged 1 commit into
masterfrom
fix-register-super-probe

Conversation

@taylortom

Copy link
Copy Markdown
Collaborator

Fixes #123

Fix

  • Extract the "is the app already listening?" probe out of registerSuperUser into lib/utils/isAppRunning.js, and treat any HTTP response as proof the app is running — including an error status. The probe requests the API endpoint map, which requires authentication, so an unauthenticated probe against a live instance gets a 401 rather than a 200. The old code only tolerated ECONNREFUSED and rethrew everything else, so register-super aborted with MISSING_AUTH_HEADER (401) before reaching auth/local/registersuper.
  • Only a refused connection now means "not listening" and triggers startApp(). Errors that are neither a response nor a refused connection (a missing conf file, an unreachable host) still propagate, so genuine misconfiguration isn't swallowed into a spurious in-process boot.

Testing

  • New tests/isAppRunning.spec.js covering all six branches: success, a 401, other error statuses, ECONNREFUSED, a non-transport error, and a non-ECONNREFUSED transport error.
  • Full suite passes (182 tests), standard clean.

@taylortom
taylortom merged commit 719d7b6 into master Aug 14, 2026
2 checks passed
@taylortom
taylortom deleted the fix-register-super-probe branch August 14, 2026 17:54
github-actions Bot pushed a commit that referenced this pull request Aug 14, 2026
## [1.2.2](v1.2.1...v1.2.2) (2026-08-14)

### Fix

* stop register-super failing against a running app (fixes #123) (#124) ([719d7b6](719d7b6)), closes [#123](#123) [#124](#124)
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 1.2.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

register-super fails against a running app instance

1 participant