Skip to content
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

Only update browser state on pjax success #660

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nickelfault
Copy link

@nickelfault nickelfault commented Jan 7, 2017

When an ajax request fails and you return false in the pjax:error event, I don't think pushState() should still be executed. When this happens you end up with an incorrect URL in the address bar. In my case, on a failure I display an alert to the user (404 not found, etc). In this case the user ends up with an inconsistent state, they see different content than the URL should provide, and if they refresh the page they'd get a whole new set of content.

@nickelfault
Copy link
Author

I did the failing tests manually and the behavior is what I'd expect after a failed request (both when returning true & false).

@fonmaxfon
Copy link

fonmaxfon commented Jan 24, 2017 via email

@nickelfault
Copy link
Author

I'm not sure what you mean by "please stop all patch"?

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