Auto-connect and register push device for guest users#1707
Conversation
StreamVideoBuilder previously only ran the auto-register-push and auto-connect block for UserType.Authenticated. Guest users fell through, forcing every Guest integrator to write the same boilerplate (manual registerPushDevice + connect after build) — boilerplate the iOS and JS SDKs don't require. Widen the gate to include UserType.Guest. registerPushDevice() and connectAsync() inside StreamVideoClient already await guestUserJob, so both are safe to fire from the builder block before /video/guest completes. Anonymous users still don't have an identity to register a device against, so they remain excluded. AND-1202
PR checklist ✅All required conditions are satisfied:
🎉 Great job! This PR is ready for review. |
SDK Size Comparison 📏
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
Walkthrough
ChangesGuest User Initialization Flow
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|



Stacked on #1704. Merge after parent.
Goal
Refs AND-1202 —
StreamVideoBuilderpreviously ran auto-register-push and auto-connect only forUserType.Authenticated. Guest integrators had to write the same boilerplate (manualregisterPushDevice+connect()afterbuild) — boilerplate iOS and JS SDKs don't require.Third behavior gap in the guest-mode series, stacked above #1703 (race fix) and #1704 (response.user adoption). Both are functional prerequisites:
registerPushDevice()andconnectAsync()awaitguestUserJob, which only works correctly with #1703.Implementation
StreamVideoBuilder.build(): widen the gate at the auto-register/auto-connect block toUserType.Authenticated || UserType.Guest. Anonymous still excluded (no identity to register against).autoRegisterPushDeviceandconnectOnInit) remain integrator-opt-out — Guest users can still set either flag tofalseto keep manual control of either path.Testing
StreamVideoClient.connectAsync(),StreamNotificationManager.registerPushDevice()) already have regression coverage inStreamVideoClientTest(added by Wait for guest user setup before firing authenticated API calls #1703) and the existing notification-manager tests.StreamVideoBuilderTestis@Ignored at class level for full builds (run viaisolatedTest), so a direct gate test would duplicate the existing isolated coverage without unique signal.Summary by CodeRabbit