barba: Page refreshed after timeout instead of redirected
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
- Go to: https://mamboleoo.be/barba/
- Open devtools and simulate 3G slow connection
- Click on
test url - You stay on the same page instead
Working demo
- Go to: https://mamboleoo.be/barba/old.html
- Open devtools and simulate 3G slow connection
- Click on
test url - You are redirected to the target page
Environment
- Barba version that exhibits the issue: ^2.8.0
- Browser OS/version used: All
Thanks for having a look at this!
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 5
- Comments: 26 (18 by maintainers)
Commits related to this issue
- fix(core): timeout reload, go to next page instead This fix #475. — committed to barbajs/barba by xavierfoucrier 2 years ago
- Review page redirection after timeout occurs See https://github.com/barbajs/barba/issues/475. — committed to barbajs/barba by xavierfoucrier a year ago
@thierrymichel Sorry I just got back on the project where I’m using Barba. I’m testing version
2.9.7and the bug seems to be still there. When usingdebug:trueit doesn’t refresh the page (so the expected behaviour) and I’m getting those console errors.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?
Closed by https://github.com/barbajs/barba/pull/653.
@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
@barba/core@2.9.7. The barba timeout is quite high at the moment so it does not happen often.I will try to create a repo soon and share it here.
Good catch, its a bug, thanks for pointing this out! 😃
I updated the demo and the issue is still occurring even with
prefetchIgnore: true😕 https://mamboleoo.be/barba/