-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[management] fix ephemeral peers hadn't been added to ephemeral list on login #5165
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -728,6 +728,11 @@ func (am *DefaultAccountManager) AddPeer(ctx context.Context, accountID, setupKe | |||||
| return fmt.Errorf("failed adding peer to All group: %w", err) | ||||||
| } | ||||||
|
|
||||||
| if temporary { | ||||||
| // we should track ephemeral peers to be able to clean them if the peer don't sync and be marked as connected | ||||||
|
||||||
| // we should track ephemeral peers to be able to clean them if the peer don't sync and be marked as connected | |
| // we should track ephemeral peers to be able to clean them if the peer doesn't sync and get marked as connected |
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.
The method
TrackEphemeralPeeris callingOnPeerDisconnected, which is semantically misleading. The intent here is to track a newly created ephemeral peer that hasn't connected yet, but callingOnPeerDisconnectedsuggests the peer was previously connected and then disconnected. While the functionality works correctly (adding the peer to the tracking list for cleanup), the naming creates confusion about the actual behavior.Consider either:
TrackEphemeralPeerto something more descriptive likeTrackNewEphemeralPeerorMarkEphemeralPeerForTrackingTrackUnconnectedEphemeralPeer)