miguelgrinberg / turbo-flask

Integration of Hotwire's Turbo library with Flask.
MIT License
301 stars 35 forks source link

Pushing updates pile up in unfocussed tab #52

Closed danricho closed 1 month ago

danricho commented 1 month ago

Hi,

I am using external triggers in my flask application to trigger turbo.push(turbo.replace(xxx)) actions.

However when my client (chrome tab) is not in focus, it isn't processed and if left out of focus long enough, the backlog can crash the browser.

What is the strategy that people use for this?

Great extension - thanks!

miguelgrinberg commented 1 month ago

This is an issue in hotwire turbo, not in this package. See https://github.com/hotwired/turbo/issues/920. They appear to have fixed the issue in v8, while Turbo-Flask uses 7.3.0 currently.

You can upgrade passing your version when you initialize the extension, for example:

{{ turbo(version="8.0.5") }}
miguelgrinberg commented 1 month ago

@danricho I just released a new version of Turbo-Flask that uses hotwire turbo 8.0.5 by default.

danricho commented 1 month ago

Thanks very much @miguelgrinberg !