Repository navigation
Allow guest interviews without GitHub sign-in - #343
Conversation
| @@ -1113,7 +1113,7 @@ function bindEvents() { | |||
| ); | |||
| }); | |||
| nodes.report.addEventListener("click", (event) => { | |||
| if (event.target.closest("#done")) window.location.assign("/"); | |||
| if (event.target.closest("#done")) leaveRoom(); | |||
There was a problem hiding this comment.
leaveRoom() calls beforeUnloadGuard.dispose() before navigating, so Done now leaves without the unload warning. A guest who has not downloaded loses the only copy with no prompt, which contradicts the status line telling them to download first, and signed-in users whose save failed lose the same protection (previously window.location.assign("/") let the guard fire). Keep the guard, or ask for confirmation, on this path when state.reportPersisted is false.
There was a problem hiding this comment.
Addressed. I added a confirmation prompt in leaveRoom() when the report has not been persisted, preventing users from accidentally leaving without saving their report.
|
Without recording, this opens interview dispatch to anonymous callers on every deployment, with no operator switch, and guests share dispatcher capacity and provider budget with signed-in users. One client can hold every slot and lock signed-in candidates out with 503. Detail is on the guest rate-limit check in |
jserv
left a comment
There was a problem hiding this comment.
Always rebase onto the latest main branch instead of merging.
1ba2423 to
e1e7d2c
Compare
|
Understood. I have rebased my branch onto the latest |
| self.config.guest_mode_enabled | ||
| && self.config.recording.is_none() | ||
| && (!self.accounts_required || self.accounts.is_some()) |
There was a problem hiding this comment.
The two-guest ceiling exists only in LocalDispatcher::reserve_with_kind. When state.dispatcher is None (the web-only deployment, agents started elsewhere), dispatch_or_release_consent returns before any guest check, and the trait's default ensure_guest_agent just forwards to ensure_agent. So any other dispatcher hands out guest room credentials with no guest cap, limited only by the per-IP token bucket, and that is trivially spread across addresses. Either require a dispatcher that enforces the guest cap here before advertising guest mode, or state that the split deployment has no guest cap and leave that to a follow-up.
There was a problem hiding this comment.
I added an explicit supports_guest_admission() capability to RoomDispatcher, with a default value of false. Guest mode is now advertised only when a dispatcher explicitly supports guest admission limits. LocalDispatcher opts in because it enforces the guest-specific capacity limit, while unsupported dispatchers fail closed.
f4ecc04 to
c897cab
Compare
|
Done. I rebased the branch onto |
jserv
left a comment
There was a problem hiding this comment.
Improve git commit messages per https://cbea.ms/git-commit/ :
- Separate subject from body with a blank line
- Limit the subject line to 50 characters
- Capitalize the subject line
- Do not end the subject line with a period
- Use the imperative mood in the subject line
- Wrap the body at 72 characters
- Use the body to explain what and why vs. how
The English writing must be improved, addressing comprehensive why vs. how.
271c586 to
ac484cb
Compare
|
I’ve revised my commit message to better explain the motivation for guest mode, its benefits for first-time users, and the rationale for retaining resource limits and limiting guest report persistence. I’ve also ensured that the message follows the project’s commit message guidelines. |
This comment has been minimized.
This comment has been minimized.
1 similar comment
|
Rebase latest |
ac484cb to
4c1a04a
Compare
|
Done. I rebased |
| StatusCode::INTERNAL_SERVER_ERROR, | ||
| json!({ "error": "Could not read account session." }), | ||
| StatusCode::FORBIDDEN, | ||
| json!({ "error": "Guest interviews are disabled." }), |
There was a problem hiding this comment.
With guest mode off, which is the default, a signed-out caller used to get 401 and "Enter your GitHub username to start an interview."; now it gets 403 "Guest interviews are disabled." That names a feature the operator never turned on and tells the candidate nothing they can act on. The two tests/cli.rs assertions that pinned the old answer were deleted rather than updated, so nothing guards the default path any more. Keep the old 401 and message whenever guest_mode_enabled is false, use this response only for an operator who enabled guests on a deployment that cannot offer them, and restore those tests.
There was a problem hiding this comment.
Addressed in e511c4f (Restore guest token admission guarantees).
When guest_mode_enabled is false, anonymous requests now retain the previous 401 Unauthorized response and the message "Enter your GitHub username to start an interview."
I also restored the CLI regression assertions to ensure the default behavior remains unchanged. Thanks for pointing this out.
Users should be able to evaluate the interview experience before connecting a GitHub account. Requiring sign-in creates an unnecessary barrier for first-time users who only want to try the service. Guest access must remain subject to resource limits to protect service availability and operating costs. Guest interview reports should not persist across sessions, while signed-in users retain their existing experience.
Keep the legacy 401 response when guest mode is disabled. Separate anonymous token rate limits from signed-in candidates. Add regression tests for both behaviors.
4c1a04a to
e511c4f
Compare
|
Thank @TMQ0717 for contributing! |
Summary
Screenshots
The following screenshots demonstrate the guest-mode interface using a local frontend preview with mocked API responses and sample report data. They illustrate the intended UI behavior and are provided for visual reference; they do not independently verify the complete end-to-end guest interview flow.
Guest interview lobby
The guest interview lobby allows users to start an interview without entering a GitHub username or signing in.
Guest interview report
Guest reports are temporary and are not persisted across sessions. The interface reminds guests to download their reports before leaving.
Testing
Notes
Guest access remains unavailable when recording is enabled or the required account infrastructure is unavailable.
Summary by cubic
Allows starting interviews without GitHub sign-in when recording is disabled and guest mode is enabled, while keeping authenticated interview behavior unchanged. Token responses now flag guests, live-room and guest-capacity bookkeeping share one mutex so concurrent reservations cannot oversubscribe a room, and the server-check script adapts to whether guest mode is available.
CODETRIAL_GUEST_MODE_ENABLED(default off) and available only when recording is disabled, the account database is reachable, and the dispatcher supports guest admission.Written for commit e511c4f. Summary will update on new commits.
close #316