Fix a few issues in metadata hub's disconnection requested flow #27193
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Before you read on: as far as I can tell the current effect of the flaws I'm about to describe on current client / production is zero, because all of the issues are masked by the fact that currently being told to disconnect by the server via any other hub will fully log the user out, implicitly severing the connection to the metadata hub too.
That said this might be changing soon (in certain circumstances, at least) as I work on ppy/osu-server-spectator#52, which is how I found this out.
To test, you can disable the aforementioned masking behaviour by applying:
After applying the above, you can perform the following test scenario on master:
master
you should see unobserved errors on every change; on this branch you should see no errors.As for the actual description of the changes:
Fix missing RPC method mapping
Pretty obvious what went wrong there.
Actually disconnect from metadata hub when requested to
Nothing in this override, on in the base implementation, would actually attempt to disconnect.
Do not attempt to stop watching user presence when requested to disconnect
First of all, this sort of cleanup isn't really the client's responsibility, and secondly, at the point the client received this
request to disconnect, none of its requests will be honored anymore (currently the only scenario of this if another client has connected - the server-side concurrency filter will reject this request).
When disconnection is requested, the only valid thing to do with respect to talking to the server is to stop doing it.
This will probably be moved server-side in a follow-up change, although I'm not even strictly sure that's required - I'd like to think signalr would know to clean up a disconnecting client from all groups they were in.
Add extended xmldoc to
DisconnectRequested()
Just expounds on what the previous commit message said.