Skip to content

[Fix]DemoApp deeplinks join cycle#1133

Merged
ipavlidakis merged 4 commits intodevelopfrom
iliaspavlidakis/fix-demo-deeplinks
Apr 23, 2026
Merged

[Fix]DemoApp deeplinks join cycle#1133
ipavlidakis merged 4 commits intodevelopfrom
iliaspavlidakis/fix-demo-deeplinks

Conversation

@ipavlidakis
Copy link
Copy Markdown
Contributor

@ipavlidakis ipavlidakis commented Apr 21, 2026

☑️ Contributor Checklist

  • I have signed the Stream CLA (required)
  • This change follows zero ⚠️ policy (required)
  • This change should receive manual QA
  • Changelog is updated with client-facing changes
  • New code is covered by unit tests
  • Comparison screenshots added for visual changes
  • Affected documentation updated (tutorial, CMS)

Summary by CodeRabbit

  • Refactor
    • Reorganized internal URL and deeplink handling flow for improved code structure.
    • Optimized auto-join functionality when initiating calls through deeplinks, consolidating previously scattered logic for better maintainability.

@ipavlidakis ipavlidakis self-assigned this Apr 21, 2026
@ipavlidakis ipavlidakis requested a review from a team as a code owner April 21, 2026 14:53
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 21, 2026

Warning

Rate limit exceeded

@ipavlidakis has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 58 minutes and 41 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 58 minutes and 41 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 46830ca1-8eaa-42c7-a7d8-f7fc09841810

📥 Commits

Reviewing files that changed from the base of the PR and between 6b14ce1 and ececdb6.

📒 Files selected for processing (5)
  • DemoApp/Sources/AppDelegate.swift
  • DemoApp/Sources/Components/Router.swift
  • DemoApp/Sources/Extensions/DemoApp+Sentry.swift
  • DemoApp/Sources/Views/CallView/CallingView/DemoCallingViewModifier.swift
  • SwiftUIDemoAppUITests/Tests/DeeplinkTests.swift
📝 Walkthrough

Walkthrough

Removed URL-handling methods from AppDelegate, eliminating custom URL scheme and universal deeplink processing entry points. Simultaneously refactored deeplink auto-join logic in DemoCallingViewModifier by extracting branching conditions into a new autoJoinIfNeeded(from:) helper method.

Changes

Cohort / File(s) Summary
AppDelegate URL Handlers
DemoApp/Sources/AppDelegate.swift
Removed application(_:open:options:) and application(_:continue:restorationHandler:) methods that previously invoked Router.shared.handle(url:) for custom URL schemes and universal deeplinks. All other app delegate functionality (push notification handling, launch setup) remains intact.
Deeplink Auto-Join Refactor
DemoApp/Sources/Views/CallView/CallingView/DemoCallingViewModifier.swift
Extracted deeplink auto-join logic into new private autoJoinIfNeeded(from:) helper that encapsulates anonymity checks, call type resolution, state updates, and join invocation. Updated .onAppear and onReceive handlers to use the helper. Removed redundant deeplink clearing from joinCallIfNeeded.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 The deeplinks once lived in AppDelegate's keep,
Now bundled in helpers, their logic runs deep,
URL schemes fade as helpers arise,
Cleaner code shines through refactor's eyes!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title '[Fix]DemoApp deeplinks join cycle' directly addresses the main objective: fixing demo app deep links causing a join cycle, which aligns with both the PR summary and the detailed changes made to URL handling and deeplink auto-join logic.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch iliaspavlidakis/fix-demo-deeplinks

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
DemoApp/Sources/Views/CallView/CallingView/DemoCallingViewModifier.swift (1)

104-117: LGTM — helper centralizes the join-cycle fix cleanly.

Clearing appState.deeplinkInfo on line 115 re-triggers the onReceive($deeplinkInfo) subscription on line 41, but the !deeplinkInfo.callId.isEmpty guard on line 105 short-circuits the second pass, so no recursion/cycle. Capturing deeplinkInfo as a parameter (rather than reading appState.deeplinkInfo after the reset) also avoids a TOCTOU-style bug — good.

Minor note: with autoJoinIfNeeded now owning the deeplink reset, the appState.deeplinkInfo = .empty on line 47 (inside onChange(of: viewModel.callingState)) is largely redundant for the deeplink-driven path, though it still serves the non-deeplink inCall transition. Worth keeping as defensive, but you could drop it if you want a single source of truth.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@DemoApp/Sources/Views/CallView/CallingView/DemoCallingViewModifier.swift`
around lines 104 - 117, Redundant deeplink reset: appState.deeplinkInfo is
cleared twice — once inside autoJoinIfNeeded(deeplinkInfo:) and again in the
onChange(of: viewModel.callingState) handler. Remove the duplicate
appState.deeplinkInfo = .empty from the onChange(of: viewModel.callingState)
block (or guard it so it only clears for non-deeplink transitions) so that
autoJoinIfNeeded owns the deeplink reset; keep autoJoinIfNeeded(from:) as-is to
avoid TOCTOU issues.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@DemoApp/Sources/Views/CallView/CallingView/DemoCallingViewModifier.swift`:
- Around line 104-117: Redundant deeplink reset: appState.deeplinkInfo is
cleared twice — once inside autoJoinIfNeeded(deeplinkInfo:) and again in the
onChange(of: viewModel.callingState) handler. Remove the duplicate
appState.deeplinkInfo = .empty from the onChange(of: viewModel.callingState)
block (or guard it so it only clears for non-deeplink transitions) so that
autoJoinIfNeeded owns the deeplink reset; keep autoJoinIfNeeded(from:) as-is to
avoid TOCTOU issues.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: de569a58-1d94-48f0-8554-a98a47052f30

📥 Commits

Reviewing files that changed from the base of the PR and between 4b87822 and 6b14ce1.

📒 Files selected for processing (2)
  • DemoApp/Sources/AppDelegate.swift
  • DemoApp/Sources/Views/CallView/CallingView/DemoCallingViewModifier.swift
💤 Files with no reviewable changes (1)
  • DemoApp/Sources/AppDelegate.swift

@ipavlidakis ipavlidakis force-pushed the iliaspavlidakis/fix-demo-deeplinks branch from a38aa47 to fde43e5 Compare April 22, 2026 11:22
@ipavlidakis ipavlidakis merged commit 636fe9e into develop Apr 23, 2026
13 checks passed
@ipavlidakis ipavlidakis deleted the iliaspavlidakis/fix-demo-deeplinks branch April 23, 2026 13:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants