-
-
Notifications
You must be signed in to change notification settings - Fork 22
Liveview example doesn't update view on click, but eats memory until OOMΒ #397
Copy link
Copy link
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug π
The liveview counter example from the Happyx website doesn't update the view when the button is clicked, but instead starts using more and more memory until OOM happens.
To Reproduce π¨βπ¬
Steps to reproduce the behavior:
- Build the example program:
import happyx
var counter = remember 0
liveview:
"/":
{counter}
tButton:
"click me!"
@click:
counter += 1
serve "127.0.0.1", 5000:
discard- Run the program and load it in Chromium (doesn't work at all in Firefox, says it can't connect to the websocket)
- Click on the "click me!" button
- Observe lack of update
- Open
htopand notice climbing memory and CPU usage in the server process - Refresh the browser and note that the state was updated (but only for the first click after each refresh; subsequent clicks send the same message that seems to have no effect, until reloading). Looking in the inspector, no response is ever received from the websocket.
- Kill the process before it eats the universe
Expected behavior π€
- Clicking should visibly update without needing to refresh the page (i.e. we should get a response from the websocket)
- The process shouldn't leak memory and go bananas
Please complete the following information π
- OS: Linux
- OS Version 6.9.3, x86_64
- HappyX version 4.7.4
- HappyX project type: liveview (it seems
ssrmust be selected if creating the project withhqx, but it's the same without hqx)
- HappyX project language: nim
- Nim/Python version: 2.2.2
- HTTP Server: default (httpbeast?)
- Browser: Chromium
- Browser Version: 132.0.6834.83
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working