Revert ForceRelay default to false now that P2P issues are fixed#152
Revert ForceRelay default to false now that P2P issues are fixed#152MichaelUray wants to merge 1 commit intonetbirdio:mainfrom
Conversation
📝 WalkthroughWalkthroughThe Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 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 |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@netbird`:
- Line 1: The PR changes the default for keyForceRelayConnection in
Preferences.java from true to false but that file wasn't included for review;
open Preferences.java and verify the change to
getBoolean(keyForceRelayConnection, false) is intentional and consistent with
the rest of the codebase, then update any related logic or documentation that
assumes the old default (search for keyForceRelayConnection, getBoolean, and any
code paths handling forced relay behavior) to align behavior and tests with the
new default, and add or adjust unit/integration tests that assert the previous
default to reflect the new false default.
In `@tool/src/main/java/io/netbird/client/tool/Preferences.java`:
- Line 30: The test
PreferencesInstrumentedTest.shouldReturnTrueWhenConnectionForceRelayedIsNotSet
must be updated to reflect the new default in
Preferences.isConnectionForceRelayed(): change the assertion that currently
calls assertTrue(...) to
Assert.assertFalse(preferences.isConnectionForceRelayed()); so the test verifies
the new default false value returned by
Preferences.getBoolean(keyForceRelayConnection, false).
- Line 30: The change to Preferences.isConnectionForceRelayed() returns false by
default which breaks the test
shouldReturnTrueWhenConnectionForceRelayedIsNotSet; revert the default to true
or update the method to return sharedPref.getBoolean(keyForceRelayConnection,
true) so that isConnectionForceRelayed() yields true when the preference is
unset (refer to the method isConnectionForceRelayed and the key
keyForceRelayConnection).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: adc3d29a-5ebe-4800-bd49-f60d8c1080f6
📒 Files selected for processing (2)
netbirdtool/src/main/java/io/netbird/client/tool/Preferences.java
ef5f776 to
206259a
Compare
The default was set to true in netbirdio#108 as a workaround for P2P stability issues on Android. Now that the underlying ICE issues are fixed (netbirdio/netbird: guard loop, candidate buffering, anet for Android), P2P connections work reliably and should be enabled by default.
206259a to
d4db909
Compare
Summary
The default for
isConnectionForceRelayedwas set totruein #108 as a workaround for P2P stability issues on Android. The underlying ICE issues have since been fixed (netbirdio/netbird: guard loop fix, candidate buffering, anet for Android interface discovery), so P2P connections work reliably and should be enabled by default.This is a one-line change:
getBoolean(keyForceRelayConnection, true)→getBoolean(keyForceRelayConnection, false).Checklist
By submitting this pull request, I confirm that I have read and agree to the terms of the Contributor License Agreement.
Summary by CodeRabbit
Related Issues
Fixes #130 — Android client defaults to force relay connection
Related netbirdio/netbird#5589 — Default Force Relay to Off
Related netbirdio/netbird#5672 — ICE Agent is not initialized yet on android app