New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mudlet freeze calling display() on adjustable container #4607
Comments
That behaviour sound consistent with an infinite recursion happening in the Lua code somehow... |
Labelling as high because it's poor behaviour, we expect Mudlet to do better here. |
Would it be fair to mark this as likely to be a lua only issue? |
Yes that is the reason. As Geyser always keeps a reference of the parent in container (myGeyserElement.container).
So instead of using display a workaround would be to use Geyser.display. |
Can we identify a Geyser object if one is given? Could make |
Maybe we can help display to never run into these infinite loops again? |
After diggin a bit I found out that prettywrite has a failsafe against infinite loops in it but it fails for Geyser in some instances (I'm not sure why) test = {}
test[1] = test
display(test) Won't cause an infinite loop. I tried to comment out Mudlet/src/mudlet-lua/lua/DebugTools.lua Line 185 in 4042ac7
|
This is the reason: lunarmodules/Penlight#38 |
Unrelated, it looks like there's an improvement for consistent key order we could take advantage of: lunarmodules/Penlight#293 |
After digging further I noticed that the issue mainly occurs if nested Labels are used (Adjustable Container right click menu uses a nested Label) Mudlet/src/mudlet-lua/lua/DebugTools.lua Line 185 in 4042ac7
I tested https://github.com/kikito/inspect.lua which does more or less the same as prettywrite and they solve this issue the same way (as of it would be if the tables[t] part was commented out) but with the difference that every duplicated table gets an id instead of a generic I also found a similar issue using the second nestable labels example from the Geyser Wiki (the one with 'mainlabel') https://wiki.mudlet.org/index.php?title=Manual:Geyser#Demo -> hover over the 'Hover there part' and then use Maybe switching from prettywrite to inspect is something to think about. |
We don't have a particular reason to stick to one - if the other is better, let's go for it. How do the two compare, could you post before/afters? |
regarding consistent key order, could just change the use of pairs to spairs and it should handle all that. That's essentially all that code snippet linked does, we've just abstracted it for use anywhere as spairs. |
It is pretty much doing the same but I don't know if it is 'better' at least it doesn't crash in Geyser (which makes it better in my opinion) ;) |
Brief summary of issue
Mudlet freezes a few seconds after typing the wrong command
Steps to reproduce the issue
Discord user chad explains:
testContainer = Adjustable.Container:new({name = "ARS main window"})
lua testContainer
in my cmd promptError output
Extra information, such as Mudlet version, operating system and ideas for how to solve / implement:
that's not just on my shit laptop, or just 1 profile.
that's on my laptop and PC (16gb ram)
on new profiles, old profiles
Mudlet 4.10.1
The text was updated successfully, but these errors were encountered: