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

Reloading diff kills the web server #10

Closed
danvk opened this issue Sep 4, 2014 · 3 comments · Fixed by #37
Closed

Reloading diff kills the web server #10

danvk opened this issue Sep 4, 2014 · 3 comments · Fixed by #37
Milestone

Comments

@danvk
Copy link
Owner

danvk commented Sep 4, 2014

webdiff listens for the onbeforeunload event and kills the web server when it fires. This usually corresponds to closing the web server, so this behavior makes sense. But if you reload, the event also fires and the reload will fail.

A solution might be to wait 0.5 seconds before killing the server.

@danvk danvk modified the milestone: 1.0 Sep 8, 2014
@ryan-williams
Copy link
Contributor

I'm not sure I understand what killing of the web server is being described here; do you have repro steps for this?

@danvk
Copy link
Owner Author

danvk commented Sep 13, 2014

Sure -- run git webdiff to open up a diff tab in your browser. Now hit ⌘R to reload the tab. The server has shut down because it thought you closed the tab.

@danvk danvk modified the milestones: 1.0, 0.8 Nov 6, 2014
@danvk
Copy link
Owner Author

danvk commented Nov 6, 2014

This is going to be quite challenging w/o switching away from the Flask dev server. werkzeug.server.shutdown has to be called from a request handler to do anything, and request handlers must be synchronous w/ the dev server. See this Q/A for details.

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

Successfully merging a pull request may close this issue.

2 participants