lona-web-org / lona

Write responsive web apps in full python
MIT License
527 stars 27 forks source link

Lona client exceedes call stack on large table update. #496

Closed lichtfeind closed 11 months ago

lichtfeind commented 11 months ago

I am useing:

When updating a large table on a channel event the Lona client explodes. It does not seem to happen when updating the html in the handle_request() method.

minimal.zip

Firefox:

LonaWorker_0                   ERROR    16:41:21.027054 lona.view_runtime client error raised:
_remove_node@http://localhost:8080/static//_lona/client2/rendering-engine.js:104:14
_clean_node_cache/<@http://localhost:8080/static//_lona/client2/rendering-engine.js:169:18
_clean_node_cache@http://localhost:8080/static//_lona/client2/rendering-engine.js:164:21
_remove_node@http://localhost:8080/static//_lona/client2/rendering-engine.js:107:14

... repeating

firefox

Chrome:

LonaWorker_1                   ERROR    07:42:30.283726 lona.view_runtime client error raised:
RangeError: Maximum call stack size exceeded
    at Map.forEach (<anonymous>)
    at LonaRenderingEngine._clean_node_cache (http://localhost:8080/static//_lona/client2/rendering-engine.js:164:21)
    at LonaRenderingEngine._remove_node (http://localhost:8080/static//_lona/client2/rendering-engine.js:107:14)
    at http://localhost:8080/static//_lona/client2/rendering-engine.js:169:18
    at Map.forEach (<anonymous>)
    at LonaRenderingEngine._clean_node_cache (http://localhost:8080/static//_lona/client2/rendering-engine.js:164:21)
    at LonaRenderingEngine._remove_node (http://localhost:8080/static//_lona/client2/rendering-engine.js:107:14)
    at http://localhost:8080/static//_lona/client2/rendering-engine.js:169:18
    at Map.forEach (<anonymous>)
    at LonaRenderingEngine._clean_node_cache (http://localhost:8080/static//_lona/client2/rendering-engine.js:164:21)

chrome

fscherf commented 11 months ago

Hi @lichtfeind!

Thanks for this detailed bug report. I can reproduce it on my system and will look into it as soon as I can.

fscherf commented 11 months ago

@lichtfeind: I found the problem and created #497. Could you verify wether my patch fixes your problem?

lichtfeind commented 11 months ago

Yes that seems to fix my issue. Thanks for the quick fix.

fscherf commented 11 months ago

@lichtfeind: Great! Thanks for testing. This fix will be in the next release.