-
Notifications
You must be signed in to change notification settings - Fork 61
Notify Go engine on network change for posture check re-evaluation #154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
MichaelUray
wants to merge
5
commits into
netbirdio:main
Choose a base branch
from
MichaelUray:fix/network-change-go-callback
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
a5a9e21
fix: notify Go engine on network change for posture check re-evaluation
MichaelUray b324342
fix: skip initial onAvailable callback to prevent login cancellation
MichaelUray 489bf16
fix: update test assertions to match new any-network-change notificat…
MichaelUray 7d64176
fix: use Log.e for exception logging in notifyNetworkChanged
MichaelUray c07433c
docs: document initialCallbackReceived multi-network limitation
MichaelUray File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: netbirdio/android-client
Length of output: 7390
🏁 Script executed:
Repository: netbirdio/android-client
Length of output: 2150
🏁 Script executed:
# Get the full test file to understand all test cases cat -n tool/src/test/java/io/netbird/client/tool/ConcreteNetworkAvailabilityListenerUnitTest.javaRepository: netbirdio/android-client
Length of output: 5200
🏁 Script executed:
Repository: netbirdio/android-client
Length of output: 115
🏁 Script executed:
Repository: netbirdio/android-client
Length of output: 1009
🏁 Script executed:
Repository: netbirdio/android-client
Length of output: 350
🏁 Script executed:
Repository: netbirdio/android-client
Length of output: 3255
🏁 Script executed:
# Get the full diff for that commit to see what changed git show b324342 -- tool/src/main/java/io/netbird/client/tool/networks/ConcreteNetworkAvailabilityListener.java tool/src/test/java/io/netbird/client/tool/ConcreteNetworkAvailabilityListenerUnitTest.javaRepository: netbirdio/android-client
Length of output: 7798
🏁 Script executed:
Repository: netbirdio/android-client
Length of output: 553
🏁 Script executed:
Repository: netbirdio/android-client
Length of output: 8345
🏁 Script executed:
Repository: netbirdio/android-client
Length of output: 135
🏁 Script executed:
Repository: netbirdio/android-client
Length of output: 1403
🏁 Script executed:
Repository: netbirdio/android-client
Length of output: 361
🏁 Script executed:
Repository: netbirdio/android-client
Length of output: 3133
🏁 Script executed:
# Let me see what the previous version of this file looked like before commit b324342 git show d277cf6:tool/src/main/java/io/netbird/client/tool/networks/ConcreteNetworkAvailabilityListener.javaRepository: netbirdio/android-client
Length of output: 1856
🏁 Script executed:
Repository: netbirdio/android-client
Length of output: 1321
Tests do not match the implementation — they will fail.
The code was rewritten to notify on any network change (lines 18-24 and 31-35), but the unit tests still expect the old WiFi-priority behavior (notify only on WiFi changes). All four tests will fail:
shouldNotifyListenerNetworkUpgraded: expects 1 but gets 2 (both MOBILE and WIFI notify)shouldNotifyListenerNetworkDowngraded: expects 2 but gets 3 (MOBILE, WIFI, then WIFI loss all notify)shouldNotNotifyListenerNetworkDidNotUpgrade: expects 0 but gets 2 (MOBILE and MOBILE loss notify while WIFI is present)shouldNotNotifyListenerNoNetworksAvailable: expects 0 and gets 0 ✓ (only passes because no networks remain)Update the test assertions to match the new behavior: any new network triggers a notification, and any lost network triggers a notification if others remain.
🤖 Prompt for AI Agents