Skip to content

Conversation

@ypconstante
Copy link
Contributor

In the project I'm working on we're getting some Cannot read properties of null (reading 'id') errors in the historyRedirect function.

This error happens when we disconnect and redirect the user in handle_params. In my tests, when pushHistoryPatch is called in this situation the socket was still connected, but it was disconnected when pushLinkPatch callback was called.

To fix the issue this PR updates pushHistoryPatch to do the connected check again in the pushLinkPatch callback.

@SteffenDE
Copy link
Collaborator

Thank you @ypconstante! Can you please try #4105? We already handle the redirect, but as you noted we still try to continue the patch while the LiveView is already unloaded. Now, instead of redirecting to the URL of the initial patch, we can just skip handling it.

@ypconstante
Copy link
Contributor Author

@SteffenDE tested #4105 and it solves the issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants