-
Notifications
You must be signed in to change notification settings - Fork 11
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
Fix a nostr subscription registration bug #201
Conversation
… subscription class
@@ -117,7 +117,7 @@ public bool EoseEventReceivedOnAllRelays(string subscription) | |||
public void MonitoringEoseReceivedOnSubscription(string subscription) | |||
{ | |||
_logger.LogInformation($"Started monitoring subscription {subscription}"); | |||
_eoseCalledOnSubscriptionClients.Add(subscription, new List<string>()); | |||
_eoseCalledOnSubscriptionClients.TryAdd(subscription, new List<string>()); |
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.
Better to add a boolean returned from the method and check it in the caller so we can identify where the duplication is from
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.
So you mean a return TryAdd(...
?
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.
Instead I logged a warning is this good enough?
this was called from RelaySubscriptionsHandling.TryAddEoseAction
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.
Return the boolean and we can handle it from the caller
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.
Handle how? log it at the caller instead?
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.
Yes, that way we can tell where the duplication happens and why
Check the dictionary _eoseCalledOnSubscriptionClients before adding a subscription class
I am not sure this is the correct fix because it might mean that we are not disposing of a subscription correctly
note this error returns until I refresh the page