fix: add timeout guard and error fallback to PDF generator pipeline#112
Open
RensTillmann wants to merge 1 commit intomasterfrom
Open
fix: add timeout guard and error fallback to PDF generator pipeline#112RensTillmann wants to merge 1 commit intomasterfrom
RensTillmann wants to merge 1 commit intomasterfrom
Conversation
- Add `SUPER.pdf_generator_abort()` helper that clears the watchdog timer, resets form state, and shows an error in the loading overlay - Start a 120-second watchdog in `pdf_generator_init` so the UI can never freeze indefinitely if PDF generation stalls - Clear the watchdog in `_pdf_generator_done_callback` on success - Add `.catch()` to the `html2canvas` promise so async render failures are caught and surfaced to the user instead of silently breaking the callback chain - Replace the bare `console.log` in the outer `catch` block with a call to `pdf_generator_abort` so synchronous setup errors also recover - Add `pdf_generation_error` i18n string to the `loadingOverlay` array in `super-forms.php` Fixes #102 Co-authored-by: Rens Tillmann <RensTillmann@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds a 120-second watchdog timer to the PDF generator so the form UI cannot freeze indefinitely if generation stalls. Surfaces errors to the user instead of silently breaking.
Fixes #102
Target Branch
masterSuper Forms Version
Targets version: v6.4.201
User Population Affected
Type of Change
Backward Compatibility Checklist
super_*hook or filter name was renamed or removed[super_form]shortcode attribute was removed or renamedFor AI-Generated PRs
Source issue: #102
Implementation confidence: ready
Files modified: src/includes/extensions/pdf-generator/, src/super-forms.php
New hooks added (if any): none
Migration required: no