Closed
Description
This is a regression in preview 9 - it works in preview 8. After a reconnection, navigation via clicking links no longer works and logs a JS error Error: Cannot send data if the connection is not in the 'Connected' State.
.
I tracked it down, and this problem was introduced when we switched from navigation working through JS interop to making it a first-class hub method in PR #12425.
The previous code maintained a single "event dispatcher" that got replaced with a newer one on each reconnection. The newer code skips updating the navigation callback entirely if it was already set. So, after reconnection, we try to dispatch a navigation method call to the old connection instead of the new one, and that fails because it's not connected.