-
-
Notifications
You must be signed in to change notification settings - Fork 475
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
Page refreshed after timeout instead of redirected #475
Comments
Hi @Mamboleoo, Have you try to disable the default barba prefetch behavior? Thanks 😉 |
I updated the demo and the issue is still occurring even with |
Good catch, its a bug, thanks for pointing this out! 😃 |
Could you try with:
Really weird but I can reproduce your issue only with no debug. |
Nervermind, got it… :) |
Hi @Mamboleoo could you check if it's ok with |
Looks like the problem still exists on 2.9.6, and like in @thierrymichel's case the issue doesn't occur when Not sure if this is intentional or not, but I also found that the page also gets refreshed instead of being redirected when clicking on a link to a page on the same site, but that page doesn't have barba wrapper nor container (let's say that I intentionally designed that page to not use barba). However, in this particular case the issue persists even with |
@thierrymichel Sorry I just got back on the project where I'm using Barba. |
@Mamboleoo I am having the same issue. Did you manage to find a fix? Can you reopen this issue? |
I just tested and it looks like this issue is patched, the reproductible repo of @Mamboleoo work as expected: the page redirect to the appropriate URL and doesn't refresh the current one. Thanks for your feedbacks 😉 |
@xavierfoucrier thank you for the heads up! Will there be a new npm release that includes the patch soon? |
Hi @nicolas-cusan, This have been patched months ago by @thierrymichel in 281c85f. But as you leave a comment, I want to be sure of that.
Thanks |
@xavierfoucrier I do not have a reproductible repo that isolates that problem at the moment. I have the issue happening repeatedly on this website in production https://www.bold.ch/ (particularly on mobile). It uses I will try to create a repo soon and share it here. |
Thanks, waiting for your feedback with the minimal repo. 😉 |
Hi @xavierfoucrier, long time. I finally have a site where this is reproducible in a reliable way (still in development): Steps to reproduce:
Background: The team page renders about a 100 records from the backend, the server response time is therefor really long (will be cached for production), but still this does represent the issue pretty well. Thank you for taking a look! Barba Version: 2.9.7 |
Hi @nicolas-cusan! Yeah, about a year ago haha 😄 Well, I understand your problematic, the fact is that if you don't want to touch anything and fix this, you will need to increase the BUT.. the fact is that you could use something pretty different, like this workflow:
This way, Barba will not "timeout" your page, and there won't be any reload 😎 |
Hello @xavierfoucrier, thank you so much for your fast reply! And thank you for your tips. The issue is not so much the reload/lack of transition (some users do not even notice), but that the user ends up on the same page he was before. In older versions (1.x) a timeout would cause a full page load but the the user would end up at the target page (team in this case). The current behavior is kind of bad from a UX / progressive enhancement point of view as the user clicks a link and does not end up there (not even with a reload). Is there a recommended way to force the link to go through if the request times out, even if it is without a transition? |
For anybody having this issue, I ended up setting I tried to use |
Hey @nicolas-cusan, Yes I probably would have asked you to test request error... I am reopening the issue and will discuss that with Thierry next time 😉 |
Thank you for looking further into it! 🙌 |
Hey, any news on this? I can confirm @nicolas-cusan `s points and observations. On timeout, I'd definitely expect a redirect to the target page, instead of reloading the current page. Wouldn't this just be a matter of replacing this with something like |
Having the same issue on a Wordpress theme equipped with BarbaJS. Running on localhost (fast DB) everything works fine, when using a remote DB (somewhat slower) this behaviour is shown. |
Can also confirm that I have the same issue. Have implemented the fix in #653 and it seems to work. |
I seem to experience a related issue. Page refreshes if the request is pending (but not on timeout) I have a page with a very basic barbajs implementation here: https://www.reddigital.dev/ Steps to reproduce:
So just to be super clear: Clicking when the page is in this state will reload the current pageClicking after the timeout behaves as expectedThis happens on every hover + click. So for this site to work on a slow connection, the user has to hover over the link for 2 seconds before clicking on it. |
This comment was marked as outdated.
This comment was marked as outdated.
Closed by #653. |
The problem
When the server takes too long to answer from a fetch, the page gets refreshed instead of redirecting the user to the target page.
It seems to be a regression since V2.8.0.
I tested with versions 2.6.1 and 2.7.2 and both are working correctly.
It's easy to reproduce by setting a very low
timeout
option value.Description
See this screenshot using the version 2.8.0 where the problem occurs

See this screenshot using the version 2.6.1 without the problem

Steps to reproduce issue [ Good To Have ]
Broken demo
test url
Working demo
test url
Environment
Thanks for having a look at this!
The text was updated successfully, but these errors were encountered: