reflex-dev / reflex

🕸️ Web apps in pure Python 🐍
https://reflex.dev
Apache License 2.0
20.36k stars 1.17k forks source link

Buttons stop working after a sequence #3461

Open SebatinCx opened 5 months ago

SebatinCx commented 5 months ago

Describe the bug A clear and concise description of what the bug is. I was trying to download in production mode and the buttons stopped working.

To Reproduce Steps to reproduce the behavior: click the "guardar" button, then "descargar" and click the "guardar" button again and all the buttons on my page stop working.

@rx.page("/") def index() -> rx.Component: return rx.center( rx.button( "Guardar", on_click=State.upload_file(), ),

    rx.button(
        "Descargar",
        on_click=rx.download(url = rx.get_upload_url("datos_aleatorios.xlsx")),

        ),
    )        

app = rx.App() app.add_page(index)



**Expected behavior**
A clear and concise description of what you expected to happen.

After reloading the page, I can repeat the process of saving and downloading files, but the buttons become unresponsive again.
No error messages are reported in the browser console.
Also happens with "reflex run"

**Specifics (please complete the following information):**

 - Python Version: 3.10
 - Reflex Version: 5.3, 5.2, 5.1, 5.0, 4.9
 - OS: Ubuntu
 - Browser (Optional):Brave, Microsoft Edge
Lendemor commented 5 months ago

Hi thanks for reporting.

This is a known bug, but we have yet to find the exact reason it happens (after downloading, it seems to cause issue with the WS in some case).

Will need to investigate more to figure out what's happening.

Lendemor commented 5 months ago

Related PR: https://github.com/reflex-dev/reflex/pull/3041

We didn't merge that PR because it would cause other unwanted side effects.

SebatinCx commented 5 months ago

I was reviewing the PR: #3041, and with the .text file that is made the example that works opens on the page as the tab and shows what the text contains. But I can't guarantee that it really works because I tried to do it with the excel file in the same way that they presented the example and it also stops working

amballa commented 1 month ago

Any update with this issue of buttons becoming unresponsive after downloading? update: the code changes in PR #3041 fixed the issue for me. Hoping unwanted side effects aren't too serious 😬