Trigger ID lifetime

Hello,

Is there any way to extend the Trigger ID lifetime from 3 seconds? I’m having some serious difficulties with that…

Longer explanation:
Mattermost sends the /commands as www-form-urlencoded data and not JSON. Also, when using /commands Mattermost also send an Authorization header, which Microsoft Flow (Power Automate) does not accept. Flow drops all the requests which include such header and it also only accepts JSON data.

So, I now have to post the request data from Mattermost to an Azure Function powershell script which parses the www-form-urlencoded data, reformats it to JSON and sends it to Flow as a new request. Flow in turn will open a webhook to request some more information from the Mattermost user by using the trigger_id.

That process takes time, and every second time it seems to take just enough over three seconds to fail the webhook with “Trigger ID for interactive dialog is expired. Trigger IDs live for a maximum of 3 seconds.”.

Now the question is: Is there any way to make the lifetime at least a slight bit longer, like 5 seconds? Or any other way to work around this issue? Technically I could maybe create the webhook also in the Azure Function phase, but they still sometimes take a bit longer than three seconds to get to that phase.

You can increase the trigger ID time out in the model/integration_action.go of the Mattermost server. The variable is INTERACTIVE_DIALOG_TRIGGER_TIMEOUT_MILLISECONDS. Then rebuild the Mattermost server and deploy.

Thanks. :slight_smile:

Although it would be nicer to have the parameter configurable or longer by default. Prefer to use the precompiled binaries and not build the server for such a small thing…

Has there been any development to this?

Still running to the same problem, now with a different project and I cannot imagine I’m the only Mattermost user interacting with a bit slow 3rd party systems with integrations?

Basically this time I trigger a command from Mattermost with a slash command, the third party system fetches data from database and processes it and then I would like to show a selection form to the user including the database query results. The query takes well over 3 seconds, so I’m once again stuck with this trigger lifetime issue and unwilling to compile Mattermost from scratch for every version upgrade.

Also, would there be any workaround?

Any idea how I could trigger an 3rd party integration process from Mattermost, allow the 3rd party system to work for some 10 seconds and still ask for more information from the users?

I’m running a bit out of ideas, as I cannot open a dialog without a valid trigger_id. Can I somehow open a dialog with “please wait…” content and then update the existing dialog with the actual data when it has been fetched from the 3rd party backend system?

I’m having the same problem here. 3 seconds is ridiculously short. There should be a config for it.