fix(enclave): land the creator in the newly created room (LC-400) #417
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/lc-400-post-create-redirect"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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_roomredirected to/enclave/{id}, which routes throughget_landing. Post-LC-336,get_landingopens the user's last-visited room (or the first openable room), never the one just created.get_last_roomupdates 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_roomdirectly 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 onlyis_redirection()(a redirect to/room/{id}still satisfies that) and fetch the room list separately, so they pass unchanged.Tests
just check,just test, andjust test-saasall pass.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>