From 03ff1cdfcedc86398abf01f267f9f31988149258 Mon Sep 17 00:00:00 2001 From: "bert.hausmans" Date: Fri, 8 May 2026 02:59:55 +0200 Subject: [PATCH] feat(form-builder): apply_deadline_seconds config key (default 5) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Per RFC-WS-6 §Q1 v1.3 addition 4. Configurable deadline for FormBindingApplicator::apply(). Default 5 seconds catches the long tail of slow applies before they hang the public flow. Tunable per environment via FORM_BUILDER_APPLY_DEADLINE_SECONDS. Consumed by ApplyBindingsOnFormSubmit::handle's withDeadline() call (landed in Phase B). Co-Authored-By: Claude Opus 4.7 --- api/config/form_builder.php | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/api/config/form_builder.php b/api/config/form_builder.php index a1b99e0f..ae31ebb6 100644 --- a/api/config/form_builder.php +++ b/api/config/form_builder.php @@ -84,4 +84,28 @@ return [ */ 'section_apply_enabled' => env('FORM_BUILDER_SECTION_APPLY', false), + /** + * FormBindingApplicator deadline in seconds. + * + * The wrapper around FormBindingApplicator::apply() throws + * FormBindingApplicatorTimeoutException if the call takes longer + * than this value. The exception is caught by + * ApplyBindingsOnFormSubmit's outer transaction handler and recorded + * as a form_submission_action_failures row with apply_status=FAILED, + * failure_response_code='temporary_error'. + * + * Default 5 seconds — typical apply() takes <100ms; the deadline + * catches the long tail (slow query against a massive person pool, + * lock-for-update wait that should have been resolved at the + * database level, etc.) before it hangs the public flow. + * + * Tune upward if a legitimate use-case surfaces (very large schemas + * with many bindings against multi-million-row entity tables). Tune + * downward if SLO requirements demand stricter response-time + * guarantees. + * + * Per RFC-WS-6 §Q1 v1.3 addition 4. + */ + 'apply_deadline_seconds' => env('FORM_BUILDER_APPLY_DEADLINE_SECONDS', 5), + ];