Repository navigation
fix(lk): a --project or --subdomain that doesn't resolve is an error - #1076
Merged
Merged
Conversation
Topherhindman
force-pushed
the
auth-tests/lk-auth-scripts
branch
from
October 23, 2026 17:11
81c5844 to
7d625e4
Compare
Topherhindman
force-pushed
the
fix/lk-named-project-no-fallback
branch
from
October 23, 2026 17:11
843292d to
56f3073
Compare
Topherhindman
force-pushed
the
auth-tests/lk-auth-scripts
branch
from
October 23, 2026 17:53
7d625e4 to
e07a424
Compare
Topherhindman
force-pushed
the
fix/lk-named-project-no-fallback
branch
from
October 23, 2026 17:53
56f3073 to
e386f8a
Compare
When --project or --subdomain named no configured project, requireProjectWithOpts treated it like nothing resolving and fell back to selectProject, which in non-interactive mode quietly used the only configured project. A typo could act on a different project than the one named. It now returns the error, which lists the configured projects, or says none are configured. With nothing named, selectProject still picks. Interactive runs change too: a mistyped name now gets the same error instead of the picker, as commands using loadProjectDetails and --user-auth already do. A named project with --dev now reports "both project and dev flags are set" instead of falling back.
Topherhindman
force-pushed
the
fix/lk-named-project-no-fallback
branch
from
October 23, 2026 19:39
e386f8a to
01d65ef
Compare
u9g
reviewed
Oct 23, 2026
| // TestRequireProjectNamedProjectIsAnError checks that a --project or | ||
| // --subdomain naming no configured project fails instead of falling back to | ||
| // the only configured one, even when prompts are skipped. | ||
| func TestRequireProjectNamedProjectIsAnError(t *testing.T) { |
Contributor
There was a problem hiding this comment.
I don’t think we need this since we have the e2e test too
u9g
approved these changes
Oct 23, 2026
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.
When
--projector--subdomainnamed no configured project,requireProjectWithOptstreated it like nothing resolving and fell back toselectProject, which in non-interactive mode quietly used the only configured project. A typo could act on a different project than the one named. It now returns the error, which lists the configured projects, or says none are configured. With nothing named,selectProjectstill picks.Behaviour that changes:
loadProjectDetailsand--user-authalready do. The picker never mentioned the typo.--devwith a named project now reports "both project and dev flags are set" instead of falling back.Left alone on purpose:
livekit.tomlnaming an unconfigured project. With no projects configured, that is how an agent repo gets offeredlk cloud auth. With some configured, the picker lets you choose, and agent commands then reject a project that doesn't match the toml's subdomain.--devwith inline credentials. It still falls back.Also:
resolveCredentialsreusesnamedProjectfor the same check, andresolveProject's doc comment says which errors still reach the picker.Testing:
TestRequireProjectNamedProjectIsAnErrorrunsrequireProjectWithOptswith--yesand a mistyped--projector--subdomain: it errors and chooses no project. Without the fix it picks the only configured one.mistyped-project.txtardrops its known-bug skip and the checks that recorded today's fallback, and gains a--subdomainrow.cmd/lkpasses.room listcan narrow to livekit.toml.