Drop the DELETE FROM rooms crutch from the onboarding fixture (LC-603) #566
Loading…
Reference in a new issue
No description provided.
Delete branch "test/lc603-onboarding-reachability"
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?
Closes LC-603.
What this is
A test-only change. LC-603 turned out to be already fixed, by LC-604 rather than by any work on this ticket, so the deliverable here is the regression coverage that locks the fix in plus a fixture that stops describing a world that no longer exists.
The original problem
show_dashboardinroutes/home.rsis!room_counts.is_empty() || !dm_counts.is_empty().db::chat::list_room_unread_countsused to count a room as accessible whenr.room_type = 'public' OR rm.user_id IS NOT NULL, andmigrations/chat/0001_create_tables.sqlseeds the public roomsgeneralandrandom. So on any seeded instance every user had at least one accessible room, always took the dashboard branch, and the LC-372 onboarding page was dead code in practice. A brand-new user landed on five cards reading "No unread channels", "No unread mentions", and so on: five negations and no next step, in place of the quick actions written for exactly that moment.Why it no longer reproduces
Two changes since. LC-604 replaced the ad-hoc predicate with
accessible_rooms_sql, which requires enclave membership before a channel counts as visible, and LC-516 removed the auto-join-to-General behaviour (backfill_general_membershiphas no callers inserver/srcany more; it is a test fixture). A fresh non-admin signup is therefore a member of no enclave, the seeded public rooms are not visible to them, and they reach the onboarding page as designed.What changed here
app_with_user(false)inserver/tests/last_visited.rsranDELETE FROM roomsto force the empty state. That crutch is gone. The fixture now only skips the backfill and leaves the user a plain member, which is precisely the state a real new signup is in, with the seeded rooms left in place.This matters because with the delete in place the two onboarding tests were asserting against an instance state that never occurs in production. They passed for a reason unrelated to the behaviour they claim to cover.
Verification
Both onboarding tests pass on current
mainwith the seeded rooms present. To confirm they are not vacuous I temporarily restored the pre-LC-604 predicate inaccessible_rooms_sql(withaccessible_rooms_bindsdropped back to 1 to match), and both fail:Restored afterwards; the diff here touches no production code. Full suite green, 181 test binaries, 0 failures.
just checkclean.The product question
The ticket asked for a deliberate call on whether a user who can see busy public rooms should still be shown onboarding. The LC-604 scoping answers it without a separate decision: "can see" now means "is a member of the enclave that owns the room". The one remaining case is an enclave member who has joined no individual rooms, who still gets the dashboard. That reads correct to me: they were admitted to a space, and its public channels are legitimately theirs. Flagging it rather than changing it silently.
🤖 Generated with Claude Code
https://claude.ai/code/session_01FhDVMViNHqUbwmfe2aXTv5