Skip to content

Feat autojoin enhancement#2

Merged
Michael-Ixo merged 2 commits intoixofrom
feat/autojoin
Feb 10, 2026
Merged

Feat autojoin enhancement#2
Michael-Ixo merged 2 commits intoixofrom
feat/autojoin

Conversation

@Michael-Ixo
Copy link
Copy Markdown

feat: add retry logic and periodic invite sweep to AutojoinRoomsMixin
The existing autojoin handler was a fire-and-forget joinRoom call with no
error handling. When joinRoom failed (rate limit, network blip, timeout),
the invite was permanently lost because the main sync token had already
advanced. This caused the state bot to silently miss invites during bulk
processing from the onboarding server.

  • Add joinRoomWithRetry with exponential backoff (500ms, 1s, 2s, 3 retries)
  • Add periodic invite sweep using a separate sync token and minimal filter
    to discover and join any missed invites (60s interval, 90s initial delay)
  • Only advance sweep sync token after all pending invites are joined,
    so failed joins are retried on the next sweep cycle
  • Prevent listener and timer leaks on duplicate setupOnClient calls
  • Add stopSweep method for clean shutdown
  • Wrap appservice invite handler with retry logic
  • Add comprehensive tests covering retry, sweep, cleanup, and concurrency

Authored by: Michael Pretorius michael@ixo.world

The existing autojoin handler was a fire-and-forget joinRoom call with no
error handling. When joinRoom failed (rate limit, network blip, timeout),
the invite was permanently lost because the main sync token had already
advanced. This caused the state bot to silently miss invites during bulk
processing from the onboarding server.

- Add joinRoomWithRetry with exponential backoff (500ms, 1s, 2s, 3 retries)
- Add periodic invite sweep using a separate sync token and minimal filter
  to discover and join any missed invites (60s interval, 90s initial delay)
- Only advance sweep sync token after all pending invites are joined,
  so failed joins are retried on the next sweep cycle
- Prevent listener and timer leaks on duplicate setupOnClient calls
- Add stopSweep method for clean shutdown
- Wrap appservice invite handler with retry logic
- Add comprehensive tests covering retry, sweep, cleanup, and concurrency

Authored by: Michael Pretorius <michael@ixo.world>
@Michael-Ixo Michael-Ixo merged commit 6e7cfca into ixo Feb 10, 2026
6 of 7 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.

1 participant