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

Progress bar does not disappear after fast network response #1202

Open
FlorianBoe opened this issue Feb 23, 2024 · 8 comments
Open

Progress bar does not disappear after fast network response #1202

FlorianBoe opened this issue Feb 23, 2024 · 8 comments

Comments

@FlorianBoe
Copy link

I found a problem with the new, latest version (8.0.3) where the progress bar does not disappear after a fast network response (also the style goes beyond a with of 100%).

The problem seems to be related to the ProgressBarDelay and the order in which events are fired.
With the default delay of 500ms and a response under 500ms, the progress bar remains. By reducing the delay (Turbo.setProgressBarDelay()) or artificially slowing down the request by throttling, the problem disappears.

This issue is maybe related to #1153.

@calleluks
Copy link

We are also seeing this.

@Intrepidd, do you think this could be related to the change introduced in #1168?

@Intrepidd
Copy link
Contributor

@calleluks this doesn't ring a bell, but I'd love to chase it down.

I haven't seen this at all, do you have any way to consistently reproduce it ? Could you provide a minimal reproduction example?
If I understand correctly, the response has to be slow enough to trigger showing the progress bar, but fast enough that it should be instantly discarded ?

@calleluks
Copy link

Thanks @Intrepidd, I really appreciate it!

Unfortunately, I'm having trouble coming up with a minimal example... I'll let you know as soon as I succeed!

@Haegin
Copy link

Haegin commented Apr 19, 2024

I'm seeing the same issue with a 3ms request and I can reproduce it reliably with my app. It's a golang backend using Turbo and Stimulus on the frontend. Would that be a useful reproduction if I can cut it down to a minimal example?

@Intrepidd
Copy link
Contributor

I guess so! I'm wondering if I should be able to reproduce with no backend at all and just html files,or a python simple http server backend. Maybe my machine is not fast enough.

I'll try to reproduce this way but any other reproduction is welcome

@Intrepidd
Copy link
Contributor

CleanShot 2024-04-19 at 11 16 34@2x

I tried to reproduce by navigating back and forth between 2 very fast pages but could not replicate the issue.

Do you see it happen on a simple visit ? Are there any HTTP redirections involved ?

@calmyournerves
Copy link

We're also seeing this with Turbo 8. We have a bunch of regression screenshots as part of our test suite, some of them now contain the progress bar at the top which wasn't the case before. We'll look into this and see if we can find a way to reproduce it.

@calmyournerves
Copy link

Update: After a little digging, we saw that in our case, this only happened in the test environment. We were using lolex (now called @sinonjs/fake-timers) to advance JS time inside our tests. Per default, lolex overrides a whole lot of timing functions, which I believe caused these issues (the Turbo progress bar uses setIntveral for example). We have now replaced lolex with some simple JS and the problem seems to be fixed for us.

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

No branches or pull requests

5 participants