Skip to content

[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

Merged
merged 6 commits into from
Jun 1, 2025
Merged

[client] Fix HA router switch #3889

merged 6 commits into from
Jun 1, 2025

Conversation

pappz
Copy link
Contributor

@pappz pappz commented May 28, 2025

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

  • Is it a bug fix
  • Is a typo/documentation fix
  • Is a feature enhancement
  • It is a refactor
  • Created tests that fail without the change (if possible)
  • Extended the README / documentation, if necessary

By submitting this pull request, you confirm that you have read and agree to the terms of the Contributor License Agreement.

- Simplify the notification filter logic.
Always send notification if a state has been changed

- Remove IP changes check because we never modify
@Copilot Copilot AI review requested due to automatic review settings May 28, 2025 14:42
Copy link
Contributor

@Copilot 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

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.

Comment on lines 506 to 509
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
Copy link
Preview

Copilot AI May 28, 2025

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.

@pappz pappz changed the title [client] Fix HA router switch. [client] Fix HA router switch May 28, 2025
pappz added 5 commits May 28, 2025 21:37
…ed to disconnected.

After implementing lazy connection, the peer state is connecting, so we did not decrease the reference counters on the routes.
Copy link

@mlsmaycon mlsmaycon merged commit f16f0c7 into main Jun 1, 2025
35 of 36 checks passed
@mlsmaycon mlsmaycon deleted the fix/ha-router-switch branch June 1, 2025 14:08
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