-
Notifications
You must be signed in to change notification settings - Fork 755
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
Unexpected Page Reload after Pausing in Debugger #1591
Unexpected Page Reload after Pausing in Debugger #1591
Comments
This is extremely annoying. Can anyone point to the most up-to-date version that does not have this problem? |
I have this problem as well. I have had some success by increasing the client heartbeat timeout:
|
@janmattfeld I'm trying to recreate this, without success - is there any way you could put together a minimal example that shows the bug? |
I already commented on this issue which seems to be related. After trying several releases, I found out the problem started with 2.24.5. I "fixed" it the same way @singlow described (although a proper fix would be very appreciated ;) ) |
We are having the same issue, and |
Same issue here. Increasing |
Actually, I noticed that increasing heartbeatTimeout didn't really fix the problem either. If I pause on a breakpoint for a few seconds, browsersync seems to reload the page anyway, only it will wait until after heartbeattimeout expires to perform the reload... |
@shakyShane I uploaded the most minimal example I could imagine and attached it to the first post.
Then set a breakpoint in the timeout within |
Small update - did some experimentation with Not sure how helpful that is, but I figured I'd comment just incase! EDIT: Still reloads when paused on breakpoints... so probably not a real solution/lead. |
page reloads when debugging and stoping on breakpoints. see : BrowserSync/browser-sync#1591
same problem here, downgrade works |
I have no issue with
Setting |
Same problem.
The increasing of heartbeatTimeout doesn't help in all cases. It just reduces the possibility of the page refreshing. It works in cases when heartbeatTimeout is not ended. What I mean by that is the following. Imagine that you have set the timeout to 60000 ms. And just 2 seconds have passed from the beginning of the timeout cycle. And then you stop the application by breakpoint for 10 seconds. 2 + 10 = 12 seconds, so the application will resume work as needed without the page refreshing. But in case when 58 seconds have passed from the beginning of timeout cycle, for instance, and then the application is stopped by the breakpoint for 10 seconds. 58 + 10 = 68 seconds. It more then heartbeat timeout, so the application will be refreshed by browsersync after resuming. |
I can confirm @mpelekh's report as well. Increasing the |
Please help, this is very annoying. |
as mentioned before, a downgrade to 2.23.7 works |
FWIW version 2.23.7 has a good number of dependencies that are flagged by npm 6 as security issues. Ideally we can find a fix to prevent the full BrowserReload event when the socket handshake closes/reopens |
This is so annoying, it happens to me too. |
Same issue here. I just roll back my browser-sync to version 2.24.1, it works. hope it could helps you fixing it in latest version. |
Doing some more sleuthing on this issue, here is what I'm finding: The reload starts when one of the polling request returns a 400 with this response: When the new socket is created, this gets called with an index > 0: https://github.com/BrowserSync/browser-sync/blob/master/client/lib/messages/Connection.ts#L24 which triggers the refresh. I removed that last line locally and it prevents the reload and continues to work as expected with the new connection. Going to submit a PR with the change. |
That last comment was premature, removing that line from Connection.ts causes other issues. |
I also "fixed" the problem by downgrading. This is a severe issue. |
Hi all, this is being worked on as a priority - thanks for your patience :) |
Ok I have a fix in place, could anyone in this thread give the alpha release a test-drive?
|
Breakdown of cause + fix: engine.io (that socket.io uses under the hood) updated some default values - this meant that whilst the debugger was paused inside applications, the connection dropped. The moment the debugger stops, a new 'connection' event is received via socket.io (as it manages to re-connect imediately) and then some code in the Browsersync client would cause a full-page reload since this re-connection event was not the 'first' one - this was done to allow situtations where a computer is put to sleep, or anything else that could cause a drop in connection. I'm no longer confident it was a good idea since this bug came around - and it's also not a good idea to increases timeouts etc. The simple solution is to no-longer reload the page automatically following a re-connection :) export function incomingConnection(
xs: Observable<IBrowserSyncOptions>,
inputs: Inputs
) {
return xs.pipe(
withLatestFrom(inputs.option$.pipe(pluck("logPrefix"))),
mergeMap(([x, logPrefix], index) => {
- if (index === 0) {
return of<any>(
setOptions(x),
Log.overlayInfo(`${logPrefix}: connected`)
);
- }
- return reloadBrowserSafe();
})
);
} |
Is this issue is resolved with 2.25.1 ? |
just had to add how happy I am as well that this one was nipped in the bud, it's been driving me bonkers as well! :D lol |
@alexpmorris glad to hear it :) |
Steps to reproduce/test case
Please specify which version of Browsersync, node and npm you're running
Affected platforms
Browsersync use-case
for all other use-cases, (gulp, grunt etc), please show us exactly how you're using Browsersync
References
There are already two Stack Overflow posts:
And a message in Slack:
The text was updated successfully, but these errors were encountered: