Skip to content

Clear internal stream map on connection close. #12212

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 5 commits into from
Jul 18, 2019

Conversation

mikaelm12
Copy link
Contributor

Fixes: #12135

Clears our internal stream map on close.

@mikaelm12 mikaelm12 added the area-signalr Includes: SignalR clients and servers label Jul 16, 2019
@mikaelm12
Copy link
Contributor Author

Needs to be updated based on conversation in #12135, going to make a draft for now

@analogrelay analogrelay added this to the 3.0.0-preview8 milestone Jul 16, 2019
assertTrue(hubConnection.getStreamMap().keySet().contains("2"));

// Verify that we clear the entry from the stream map after we clear the first stream.
stream.onComplete();
Copy link
Member

@halter73 halter73 Jul 17, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we verify the streamMap entry gets removed when sendHubMessage completes with an error?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was just thinking this as I was headed to the restroom. I'll complete the second stream with an error and verify.

@@ -109,6 +109,11 @@ void setTickRate(long tickRateInMilliseconds) {
this.tickRate = tickRateInMilliseconds;
}

// For testing purposes
Map<String,Observable> getStreamMap() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: space

@mikaelm12
Copy link
Contributor Author

@mikaelm12 mikaelm12 merged commit 7d08882 into master Jul 18, 2019
@mikaelm12 mikaelm12 deleted the mikaelm12/ClearStreamMap branch July 18, 2019 00:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-signalr Includes: SignalR clients and servers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

StreamId Map should be cleared when connection is stopped
5 participants