fix(enclave): land the creator in the newly created room (LC-400) #417

Merged
longjacksonle merged 1 commit from fix/lc-400-post-create-redirect into main 2026-06-20 23:50:11 +02:00

Follow-up to LC-400

After the modal fix (#416), the second half of LC-400: creating a room dropped you back into your previous room instead of the new one.

Cause

post_create_room redirected to /enclave/{id}, which routes through get_landing. Post-LC-336, get_landing opens the user's last-visited room (or the first openable room), never the one just created. get_last_room updates only when a room is opened, so it returned the room you were already in - you got bounced straight back and the creation looked like a no-op, even though the room existed and now showed in the sidebar.

Fix

Redirect post_create_room directly to /room/{room_id} (the new room). The creator can always open it: a public room is openable to every enclave member, and a private room adds the creator as a member just above the redirect. The duplicate-name branch is unchanged (/enclave/{id}?error=room_name_taken) so the flash path still works.

Scope

One-line redirect target change in server/src/routes/enclave.rs. No new env vars, no schema change. Both create-room tests assert only is_redirection() (a redirect to /room/{id} still satisfies that) and fetch the room list separately, so they pass unchanged.

Tests

just check, just test, and just test-saas all pass.

## Follow-up to LC-400 After the modal fix (#416), the second half of LC-400: creating a room dropped you back into your previous room instead of the new one. ## Cause `post_create_room` redirected to `/enclave/{id}`, which routes through `get_landing`. Post-LC-336, `get_landing` opens the user's last-visited room (or the first openable room), never the one just created. `get_last_room` updates only when a room is opened, so it returned the room you were already in - you got bounced straight back and the creation looked like a no-op, even though the room existed and now showed in the sidebar. ## Fix Redirect `post_create_room` directly to `/room/{room_id}` (the new room). The creator can always open it: a public room is openable to every enclave member, and a private room adds the creator as a member just above the redirect. The duplicate-name branch is unchanged (`/enclave/{id}?error=room_name_taken`) so the flash path still works. ## Scope One-line redirect target change in `server/src/routes/enclave.rs`. No new env vars, no schema change. Both create-room tests assert only `is_redirection()` (a redirect to `/room/{id}` still satisfies that) and fetch the room list separately, so they pass unchanged. ## Tests `just check`, `just test`, and `just test-saas` all pass.
fix(enclave): land the creator in the newly created room (LC-400)
All checks were successful
check-secrets / TruffleHog (push) Successful in 4s
check-secrets / Nosey parker (push) Successful in 4s
check-secrets / Kingfisher (push) Successful in 6s
check-secrets / Nosey parker (pull_request) Successful in 3s
check-secrets / TruffleHog (pull_request) Successful in 5s
check-secrets / Kingfisher (pull_request) Successful in 7s
Create release / Create release from merged PR (pull_request) Has been skipped
Check / clippy + fmt + tests (pull_request) Successful in 4m16s
7a781b599b
post_create_room redirected to /enclave/{id}, which bounces through get_landing. After LC-336, get_landing opens the user's last-visited (or first openable) room - not the one just created - so creating a room dropped the user back where they were and felt like a no-op even though the room existed and showed in the sidebar.

Redirect straight to /room/{room_id} instead. The creator can always open it: a public room is openable to every enclave member, and a private room adds the creator as a member just above. The duplicate-name branch still redirects to /enclave/{id}?error=room_name_taken so the flash path is unchanged.

One-line redirect target change. just check, just test, just test-saas all pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
longjacksonle deleted branch fix/lc-400-post-create-redirect 2026-06-20 23:50:11 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
psa-systems/lets-chat!417
No description provided.