Sync upstream updates: queue retry deadlines, inline Blade templates and batch completion
Merged
BI
1d ago+2785+2785+0123456789012345678901234567890123456789-442-442-012345678901234567890123456789
Laravel Updates
- #62435 — Add releaseUsingBackoff() to InteractsWithQueue, which releases a job using the backoff for its current attempt. Document it under manually releasing jobs.
- #62434 — Add the RetryFor queue attribute for jobs, queued listeners, mailables and notifications, and refresh its deadline when queue:retry retries a job. Document it under time-based attempts.
- #62433 — Cover cursor pagination of unions ordered by an aliased expression. Hypervel pages union members by column position and asks for fromSub() when a paging column is computed, so the test checks that guidance and the fromSub() form.
- #62430 — Allow from() with a subquery and no alias.
- #62419 — Add RawTemplate for inline Blade components, with the inline make:component stub and documentation.
- #62465, facade docblocks — Add withoutAffectingStickiness() to database connections, so writes inside the callback don't send later reads to the write connection. Regenerate the DB facade and document it.
- #62464 — Port the wildcard primary-attribute validation tests. Hypervel's existing reverse lookup map already resolves these in one pass, so the source keeps it.
- #62455 — Render bound attributes of dynamic components the same way as the component tag.
- #62451 — Extend the tagged Redis cache read tests. Hypervel already reads tagged keys with a single MGET, so the tests check that instead of a pipeline.
- #62260 — Mark batches that allow failures as finished once all their jobs have run. BatchFinished is still dispatched only when all of them succeed.
- Merge resolution dd89c801a4 — Let findOrFail() and findOr() accept models, comparing the found rows by key, including on through relations. Port master's logger assertions for exception context.
- #62369 — Add min(), max(), between() and exactly() to the list rule builder, with documentation.
- #62383 — Name the renamed sticky-connection worker tests in the note explaining their removal. Each Hypervel queue job already runs with its own record-modification state.
- #62375 — Remove unused protected methods.
- #62370 — Use Exceptions::fake() in the exception-throttling reporting tests.
Additional Hypervel changes
- Refresh a queued listener's deadline on queue:retry from its retryUntil() method, called with the original event, or from its RetryFor window. Previously the retried job kept its expired deadline from dispatch and failed straight away. A job's own retryUntil property is no longer replaced by its RetryFor window.
- Use hypervel_table as the default alias for an unaliased from() subquery, since PostgreSQL rejects the empty alias Laravel uses.
- Stop Blade::render() with deleteCachedView from deleting a template file that a component or another render of the same template is still using. Each such render now compiles its own copy and removes it afterward.
- Decide whether a batch that allows failures has finished from its distinct failed job IDs, inside the same locked update, so a job that fails more than once is counted once. A retried job that is still listed as failed keeps batching() true, and Horizon retries keep the original batch job ID, so "Retry batch" no longer re-runs completed jobs.
- Count batched jobs that use Batchable without InteractsWithQueue, so their batches finish and a retry still runs after its batch finishes with failures.
- Keep backoff schedules given as lists or comma-separated --backoff options, such as those Horizon passes to its workers. Previously workers kept only the first delay, and a list returned by a job's backoff() became "Array". A schedule is also kept when the deprecated --delay is passed.
- Make find() with models or a collection of models query only their keys. Previously every attribute value was used as a key, so it could return unrelated rows, and findOrFail() failed with "Array to string conversion". findOrFail() and findOr() also read a lazy collection of IDs only once.
- Keep requested numeric cache keys in many() and get() from taking another entry's default on a miss.
- Keep a coroutine's cancellation visible when it interrupts Sleep, instead of letting the rest of the sleep or its next while() iteration clear it.
- Detect streaming HTTP cancellation only at the transport's own waits, so requests made after a handled cancellation no longer fail. Require hypervel/guzzle 8.5.0.2 in every package that uses it, since its transport stops promptly on cancellation.
- Report AWS credential failures as cancellations only when this call's own waits were canceled.
- Classify Redis cancellation at each native operation, so ordinary phpredis failures after a handled cancellation keep their RedisException.
- Check generated PHP with php -l before writing it, so make: commands no longer write classes PHP can't load, such as one named like a class it imports (make:mail Envelope) or a nested reserved name (make:model School/Class). The command stops with PHP's error before writing, even with --force. A name on the reserved list now fails the command too, so --force no longer creates its companion files.
- Track removing native Windows runtime support and Pest integration in the todo list.
[!NOTE]
Sync upstream: RetryFor queue deadlines, inline Blade templates, batch completion
- Adds the class-level
RetryFor attribute (seconds, minutes, hours) as a retry window for jobs, queued listeners, mailables, and notifications; retryUntil methods/properties still take precedence (RetryFor.php, Queue.php, RetryCommand.php)
- Adds
RawTemplate for inline Blade rendering: component render() may return a RawTemplate or a closure producing one, compiled to content-hashed view names with a static cache cleared by flushCache (RawTemplate.php, Component.php, BladeCompiler.php); make:component --inline generates RawTemplate-based components
- Fixes batch completion: allow-failures batches finish when all jobs have run once even if only failures remain, and Batchable-only commands (without
InteractsWithQueue) are now counted for batch success/failure via a WeakMap of command-to-job IDs (Batch.php, DatabaseBatchRepository.php, CallQueuedHandler.php)
- Adds
InteractsWithQueue::releaseUsingBackoff plus array and comma-separated backoff schedule support in worker/listener options, and hardens Redis connection cancellation classification (native phpredis exceptions carrying a cancellation are converted to CanceledException)
- Also shares
parseFindIds/normalizeFindIds ID normalization across Eloquent relations and builders, adds Rule::list() with size constraints, and adds Connection::withoutAffectingStickiness
- Behavioral Change: allow-failures batches now finish while failed jobs remain pending (previously stayed unfinished),
queue:work --backoff schedules are fully honored per attempt, Redis operations that carry a cancellation now throw CanceledException instead of the native error, and Rule::list() returns a chainable ListRule object instead of a string
Macroscope summarized 75dc0ab.
Summary by CodeRabbit
- New Features
- Added fixed-duration queue retries, backoff-based manual job releases, and configurable backoff schedules for workers.
- Batches that allow failures can finish once every job has run, while failed jobs remain eligible for retries.
- Added raw Blade templates for components and fluent list validation with size constraints.
- Improved model lookups with model collections and one-time lazy ID sources; added database reads that preserve prior write-routing behavior.
- Generated code now checks for reserved names and conflicting imports before writing files.
- Bug Fixes
- Improved handling of streaming request cancellation, Redis cancellation, cache defaults, and queries without table aliases.
- Documentation
- Updated guidance for queue retries, batch completion, Blade templates, database routing, and Windows support.