Skip to content

Conversation

@doromaraujo
Copy link
Contributor

@doromaraujo doromaraujo commented Dec 18, 2025

Also solves UI issue for iOS prior to 16 to display the navigation drawer

Summary by CodeRabbit

  • Refactor

    • Adjusted navigation bar handling to improve on-screen behavior and consistency.
    • Updated tunnel restart state management for more reliable connection handling.
  • Chores

    • Incremented project build version metadata.

✏️ Tip: You can customize this high-level summary in your review settings.

Copilot AI review requested due to automatic review settings December 18, 2025 19:53
@coderabbitai
Copy link

coderabbitai bot commented Dec 18, 2025

Walkthrough

Moved navigation-bar modifiers from the outer NavigationView into the inner content view, deferred restart-state flag resets in PacketTunnelProvider.restartClient onto monitorQueue.async, and bumped the NetBird project CURRENT_PROJECT_VERSION from 15 to 16.

Changes

Cohort / File(s) Summary
Navigation bar modifier reorganization
NetBird/Source/App/Views/MainView.swift
Navigation bar modifiers (.navigationBarTitleDisplayMode(.inline) and .navigationBarHidden(true)) moved from the outer NavigationView to the inner content (ZStack)
Restart-state flag clearing threading
NetbirdNetworkExtension/PacketTunnelProvider.swift
In restartClient, clearing of adapter.isRestarting and isRestartInProgress is deferred to monitorQueue.async { ... } instead of being reset inline, changing the execution context/timing
Project version bump
NetBird.xcodeproj/project.pbxproj
CURRENT_PROJECT_VERSION incremented from 15 to 16 for the NetBird target in build configurations

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • PacketTunnelProvider.swift: verify deferring resets to monitorQueue doesn't introduce race conditions or change expected restart completion timing.
  • MainView.swift: confirm navigation bar appearance/behavior remains as intended across navigation stacks and iOS versions.
  • project.pbxproj: ensure version bump is deliberate and aligns with release/versioning process.

Possibly related PRs

Suggested reviewers

  • mlsmaycon

Poem

🐇 I hopped through code with gentle taps,

moved bars inside and queued the claps,
flags now rest on async streams,
versions nudged toward bigger dreams,
a small clean hop — hooray, perhaps!

Pre-merge checks and finishing touches

❌ 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%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title focuses on a racing condition in isRestartInProgress, which is directly addressed in PacketTunnelProvider.swift changes, but the changeset also includes an unrelated UI fix for navigation bar display in MainView.swift and a version bump.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch bug/racing-condition-is-restart-in-progress

📜 Recent review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 60885a9 and f4fd16b.

📒 Files selected for processing (1)
  • NetBird.xcodeproj/project.pbxproj (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Build iOS App
🔇 Additional comments (1)
NetBird.xcodeproj/project.pbxproj (1)

932-932: LGTM: Version bump is consistent across configurations.

The build version increment from 15 to 16 is appropriate for this bug fix release. Both Debug and Release configurations are updated consistently.

Note: The actual code changes addressing the race condition (in PacketTunnelProvider.swift) and the UI fix for iOS <16 (in MainView.swift) mentioned in the PR description and AI summary are not included in this file for review.

Also applies to: 984-984


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

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a race condition in network restart handling and resolves a navigation drawer display issue on iOS versions prior to 16.

  • Ensures thread-safe access to isRestartInProgress and adapter.isRestarting flags by dispatching modifications to the designated monitorQueue
  • Corrects SwiftUI modifier placement for navigation bar configuration to support iOS <16

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
NetbirdNetworkExtension/PacketTunnelProvider.swift Wraps flag resets in monitorQueue.async block to prevent race conditions when adapter callbacks complete on non-monitor threads
NetBird/Source/App/Views/MainView.swift Moves navigation bar modifiers from NavigationView to content ZStack for proper iOS <16 compatibility

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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