Fork me on GitHub
#re-frame
<
2022-01-24
>
Mynus04:01:43

Hello, Every-time a subscription with a normal query is triggered, browsers just freeze with no error message. Been trying to fix it for a few days now but found no reason for this to happen. Have you ever come across something like this?

p-himik09:01:47

Try putting some (js/console.log ...) statement in the handler function of that subscription - does it inundate the browser's JS console with messages when the page freezes? If so, then you probably update your state in a render function - and you should never do that.

p-himik09:01:38

If you aren't updating the state in any render functions then I'd be interested in taking a look, so if you don't figure it out on your own please create a minimal reproducible example and I'll check it out.

Mynus11:01:18

@U2FRKM4TW Thanks for reply. It doesn’t seem to be the case of state being updated in render function.

p-himik11:01:32

Does the whole browser freeze or only the web UI of your app? If it's the latter, then when it happens you can open the JS console, go to the "Scripts" tab, and press the Pause button. It should land you some place in a [potentially implicit] busy loop.

Mynus11:01:24

@U2FRKM4TW Nothing helpful with pause. Thanks

Mynus11:01:56

Here is a reproducing version of it. Maybe you can see something I am unable to. (Trouble comes after clicking a “New Variant” inside “Unordered Collection”.)

p-himik11:01:46

You have while in one of your views.

1
p-himik11:01:55

That's literally an infinite loop in your case.

Mynus13:01:17

Thank you. Silly mistake. Grateful :man-bowing:

👍 1
Mynus16:01:53

Curiosity: When does it idiomatically make sense to use Record and Protocol inside Re-Frame?

p-himik16:01:25

Not specific to re-frame at all.

👍 1