Skip to content

Auto-join space rooms when accepting space invites - #56

Merged
KallynGowdy merged 1 commit into
devfrom
claude/gifted-clarke-171ydy
Sep 28, 2026
Merged

KallynGowdy merged 1 commit into
devfrom
claude/gifted-clarke-171ydy

Conversation

@KallynGowdy

Copy link
Copy Markdown
Contributor

Description

When a user accepts an invite to a space, automatically join all joinable rooms within that space in the background. This improves the user experience by populating the space with its child rooms without requiring manual joins.

Changes:

  • Added joinSpaceRooms.ts utility module that:

    • Fetches the space hierarchy using paginated requests
    • Filters out already-joined rooms, the space itself, and unjoinable rooms (invite/knock/private join rules)
    • Joins remaining rooms with rate limiting (3 concurrent requests) using advertised via servers
    • Gracefully handles failures without throwing (space join already succeeded)
  • Updated Invites.tsx to call joinSpaceRooms() after accepting a space invite

  • Updated CommunityList.tsx to call joinSpaceRooms() after joining a community space

  • Added comprehensive unit tests for getSpaceRoomsToJoin() covering:

    • Correct filtering and ordering of rooms
    • Via server extraction from space.child events
    • Deduplication and join state handling

Test Plan:

Added unit tests in joinSpaceRooms.test.ts covering the room filtering and via server logic. Run npm test to verify.

Fixes #

https://claude.ai/code/session_01SW3Ebb16smU9Xmr7hRTgg2

After joining a space from an invite (inbox Invites page or the app shell's
community invite row), fetch the space hierarchy and join every room and
sub-space the user hasn't joined yet, in the background so navigation isn't
held up. Invite-only and knock rooms are skipped, failed joins are ignored,
and rate limits are retried.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SW3Ebb16smU9Xmr7hRTgg2
@KallynGowdy
KallynGowdy merged commit 8970f2f into dev Sep 28, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants