[Bug] InternalError: too much recursion [Solved]

Got this today after posing a link. The front-end stopped responding and I can’t seem to connect anymore D:

Uncaught (in promise) InternalError: too much recursion
    u formatText.js:35
    f charLogUtils.js:23
    D charLogEvents.js:13
    pose CharLog.js:36
    e CharLogEvent.js:15
    value CharLog.js:390
    u CharLogComponent.js:88
    _renderComponents CollectionList.js:179
    render CollectionList.js:119
    value CharLogComponent.js:92

The front end hung for me too. Clearing my cache and reconnecting got the UI to halfway draw and freeze, just now.

I have also experience frontend freezes. But I have yet been unable to determine what causes them, as I haven’t gotten any error in Chrome’s console.

Also, my freezes hasn’t been total; I’ve still been able to type and send commands. But nothing shows. And I’ve been able to resolve it by reloading with F5. So it might be a different issue.

In any case; this recursion error may be a very good hint!

Thanks for reporting, @Makyo! I take it you use Firefox?

The issue comes when the client tries to render some stored logs in the central chat/character log panel. But it fails and breaks stuff.

I guess the problem comes when you try to wake up your character, right?

That last line that causes it (formatText.js:35) is the line where it tries to run a regex to format a link (included in a pose ) and make it clickable. Something with your link and that regex fails.

@Makyo, I missed that you actually said you posted a link!

Do you still have that link for me to try with? (you can also message me it, if you don’t want to paste it on the forum).

And welcome to the forum! :smiley:

I have have a similar problem. My chat pane shows up to a whisper at 17:44 and then ceases to show anything else. Yesterday, before this mornings’s ‘Update’, my log ended there. Now, it gets to that spot and shows a bunch of empty lines. Lines I suspect are commands I sent but received no data for, as each time I try running ‘help’ and then refresh my page when nothing shows up, the blank space grows larger. Currently I cannot scroll that pane, either. I’ve tried sleeping, logging out, restarting browser, and closing the tab.

[Update]
Upon inspecting the page, Firefox shows me the same recursion error.

[Update 2]
And now it seems to be working for me. Yay!

Welcome to the forum, @Vernon_Otter!

I have figured out why it started working after a while as well;

The link parser broke/froze any client that received the pose with the link.

Every time the client was reloaded, it resynchronized any missed message stored in the log service on the server. That means, it fetched the pose message again, and the client crashed… again.

The log service evicts any message older then 2 hours. So after that 2 hours, a reloaded client no longer received the pose, thus didn’t crash anymore.

Now. While I don’t know what URL caused it to crash, I can still add a safe-guard (try-catch) that prevents any error to cause the client to freeze!

I released a bug-fix version which catches any such errors, logs them, and prevents the client from crashing.

Turns out the bug-fix wasn’t very efficient on all browsers, depending on regex engine.

Now I know a bit more though.
The issue is caused by Runaway Regular Expressions: Catastrophic Backtracking .
You can try out an example here: regex101: build, test, and debug regex
The base of the regex is borrowed from: Daring Fireball: An Improved Liberal, Accurate Regex Pattern for Matching URLs

Now I will try to make a proper fix.

Edit:
It seems using regex to parse complex markdown-like links may not be an option. Especially if you want to handle odd cases like links with opening and closing parentheses:

ooc Have you see Saw (https://en.wikipedia.org/wiki/Saw_(2003_film))?

It seems quite easy to make the client break with illicit input. I’d better look for a Javascript markdown-link parser.

Resolved in Release v1.31.2 - Text formatting