fix(queue): restore background processing refactor lost in Phase 1 merge#1656
Merged
Conversation
Phase 1 (#1655) carried the bootstrap-level pieces of hot-patch's queue work (GF_Background_Process loader, gfpdf_settings_sanitize queue-toggle hook, 4-arg Controller_Pdf_Queue construction) but the auto-merge took dev's copy of Controller_Pdf_Queue / Queue_Callbacks / Test_Controller_Pdf_Queue. That left the controller's constructor silently dropping its $form dependency and discarded the substantive changes from four hot-patch commits: dc772da Update Background Processing Queue (GF 2.9.7/2.9.8 compat) 8a7914d Convert mini-queues to individual queue items; drop 'unrecoverable' flag; retry from 3 -> 1 389ae6c Add queue cleanup when Background Processing toggled 3fe1c1e Use the correct entry on resend; dedupe identical PDFs This commit re-applies those four commits' intent on top of dev's queue baseline: * Controller_Pdf_Queue - Accept Helper_Form via the 4th constructor arg (matches the call site already in bootstrap.php). - Group $form_async_notifications by [formId][entryId] so resend iteration can re-fetch fresh form/entry data from the DB instead of using stale request-time arrays. - queue_dispatch_resend_notification_tasks() now ignores legacy $form/$entry params, fans out per form+entry pair, and dispatches once at the end. - dispatch_queue is hooked separately on gform_after_submission priority 100 (instead of inline from queue_async_form_submission_tasks), so the resend path can reuse the same dispatch hook. - queue_async_tasks pushes one task per queue item (forwards compat with the new GF library). - Drop 'unrecoverable' => true so a single failure doesn't block other PDFs/notifications. - args carry get_current_user_id() so dev's {user} merge-tag masquerade keeps working. * Queue_Callbacks::create_pdf - Wrap GPDFAPI::create_pdf() with gfpdf_override_pdf_bypass=false so a queued PDF generates even if the request-time bypass filter would normally short-circuit it. * queue_cleanup_task / Queue_Callbacks::cleanup_pdfs stay deprecated per dev's caching-layer + auto-purge direction (6.12). The cleanup queue entries that hot-patch's controller used to push are no longer scheduled, and the tests assert the reduced queue size. Helper_Pdf_Queue.php is identical between dev and hot-patch already (retry budget = 1, etc.) so no changes are needed there. Verified locally: * composer phpcs:lint -- clean * yarn lint:js -- clean * yarn test:php (1119 tests, 4088 assertions) -- all pass Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## development #1656 +/- ##
============================================
Coverage 92.85% 92.85%
============================================
Files 58 58
Lines 1511 1511
Branches 419 419
============================================
Hits 1403 1403
Misses 103 103
Partials 5 5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Summary
Phase 2 of the hot-patch ↔ development reconciliation. Phase 1 (#1655) merged hot-patch's bootstrap-level queue wiring (`GF_Background_Process` loader, queue-toggle cleanup hook, 4-arg `Controller_Pdf_Queue` construction) but the auto-merge took dev's copies of `Controller_Pdf_Queue`, `Queue_Callbacks`, and `Test_Controller_Pdf_Queue` — leaving the controller's constructor silently dropping its `Helper_Form` dependency and discarding the substantive changes from four hot-patch commits.
This commit re-applies those four commits' intent on top of dev's queue baseline:
`Helper_Pdf_Queue.php` is identical between dev and hot-patch already (retry budget = 1), so no changes there.
Dev's intent preserved
Test plan
🤖 Generated with Claude Code