-
-
Notifications
You must be signed in to change notification settings - Fork 707
[client] Fix HA router switch #3889
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
Conversation
- Simplify the notification filter logic. Always send notification if a state has been changed - Remove IP changes check because we never modify
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.
Pull Request Overview
A bug fix for the HA router switch that simplifies the notification filter logic and removes unnecessary IP update checks.
- Removed redundant IP update logic in peer state update functions.
- Simplified the notification condition in shouldSkipNotify to only check for connection status changes.
client/internal/peer/status.go
Outdated
if receivedConnStatus == curr.ConnStatus { | ||
return true | ||
case receivedConnStatus == StatusIdle && curr.ConnStatus == StatusConnecting: | ||
return true | ||
case receivedConnStatus == StatusIdle && curr.ConnStatus == StatusIdle: | ||
return curr.IP != "" | ||
default: | ||
return false | ||
} | ||
return false |
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.
[nitpick] Consider returning the boolean expression directly (i.e., 'return receivedConnStatus == curr.ConnStatus') to simplify the code.
Copilot uses AI. Check for mistakes.
…ed to disconnected. After implementing lazy connection, the peer state is connecting, so we did not decrease the reference counters on the routes.
|
Fix HA router switch.
Describe your changes
Simplify the notification filter logic. Always send notification if a state has been changed
Remove IP changes check because we never modify
Issue ticket number and link
Stack
Checklist