verbb / formie

The most user-friendly forms plugin for Craft CMS.
Other
95 stars 73 forks source link

LitEmoji causing timeouts over ajax submissions #2048

Open jhealey5 opened 1 month ago

jhealey5 commented 1 month ago

Describe the bug

We have a front-end form with an autopilot integration which, after updating to 3.15+ causes timeouts and subsequently fails to submit the form when using client-side ajax submissions.

I've tracked it down to the LitEmoji helper on line 409 of src/base/Integration.php

$settings = Json::decode(LitEmoji::shortcodeToUnicode(Json::encode($settings)));

Removing the LitEmoji::shortcodeToUnicode method prevents the timeout occurring.

Is there some way to disable this or otherwise fix it? We can't upgrade this client to Craft 4/5 just yet.

Steps to reproduce

Not sure if this can be easily re-created, may depend on several factors including server.

Form settings

Craft CMS version

Craft Pro 3.9.13

Plugin version

1.6.45

Multi-site?

No

Additional context

No response

jhealey5 commented 3 weeks ago

Any movement suggestions here?

engram-design commented 3 weeks ago

Formie 1 support has wrapped up so I'm hesitant to make this potentially breaking change by just removing the LitEmoji::shortcodeToUnicode method call.

It's not something I can replicate though, and I have a bunch of integrations enabled for testing purposes. It could be something unique with your Autopilot integration.

I don't suppose you could alter that line to:

Craft::dd(Json::encode($settings));

And send through the resulting JSON string, so I can test what you see? Feel free to send to support@verbb.io if you'd rather keep it private.

jhealey5 commented 3 weeks ago

Hey @engram-design Thanks, I've just emailed that to you.

Appears it might be down to the size of that json - I suspect 12mb of settings is too much and so the server times out?

engram-design commented 3 weeks ago

Thanks for sending that through, and you're right - that's likely the real issue here. Looking through your data, it seems like you've both got a lot of lists, and a lot of fields on each of those lists. Formie is going to be saving all those in the database as a reference, so we'll probably need to do our processing later, and just for the list data you've picked.

I'll have to play around with some options on this.