Sync Laravel updates for queues, database, JSON:API and FTP
Merged
BI
1d ago+3204+3204+0123456789012345678901234567890123456789-183-183-012345678901234567890123456789
Laravel Updates
- #61942 — Fix
touch()on through relationships by updating the related table through its selected IDs, preserving intermediate soft-delete constraints. - #61965 — Batch Redis bulk-dispatch payloads and notifications together. Keep bounded buffers, mixed immediate/delayed ordering and exact completion counts.
- #61973, #61974, #61985, #62010 — Reconcile regression coverage for repeated scheduled callbacks and unique queue locks after transaction rollback or failed dispatch. The existing coroutine state and lock ownership already handle these paths.
- #61981, #61977 — Support
UniqueForattributes on broadcast events and make Mercure delivery synchronous by default, with an explicit async option. Update configuration and the corresponding broadcasting documentation. - #61979 — Preserve fractional process and idle timeouts supplied as
CarbonIntervalvalues. - #61995 — Prevent queries run during reconnection from recursively reconnecting the same logical connection.
- #61993 — Skip contextual container lookup when no contextual bindings are registered.
- #61991 — Apply model casts to extra attributes supplied to increment and decrement operations.
- #62007 — Check scheduler overlap locks without acquiring and releasing them.
- #62017 — Reconcile fake-aware limiter timeout behavior and its regression coverage.
- #62014 — Constrain both information-schema tables when inspecting MySQL and MariaDB foreign keys, avoiding work across unrelated databases.
- #62009, #62043 — Fix self-referencing one-of-many existence, count and aggregate queries. Establish the related alias before merging joins and keep aggregate subquery models independent of outer aliases, including soft-deleted and polymorphic relations.
- #61970 — Include elapsed runtime in failed scheduled-task events and document its units and nullable value.
- #62000, #62023, #62152 — Retain JSON:API relationship-loading customization while preserving whole-level batching for default includes. Filter conditional attributes before expanding their keys, and complete nested-include and collection coverage.
- #61998 — Qualify the deleted column when restoring joined models.
- #61972 — Add
detect_mime_type_using_pathto FTP and SFTP disks, with adapter coverage and documentation. - #61901 — Allow
queue:forgetto process multiple IDs, report each result and return failure if any ID is missing. - #62024, #62149 — Qualify implicit
latest()andoldest()timestamps on joined Eloquent queries while preserving explicit columns, union outputs and subquery sources.
Additional Hypervel Fixes
- Keep the reconnect guard active while non-PDO leases announce replacement connections, so listener queries cannot restart the reconnect cycle.
- Bind binary increment/decrement extras correctly and report the actual written cast values without rerunning setters. Preserve pending observer edits and call public
syncChanges()overrides during save and increment, with isolation for nested writes and exceptions. - Preserve selected scopes, custom projections and binary keys when touching through and pivot relations. Batch unbounded PDO updates within the connection's binding limit; keep limited or offset updates in one statement so their selection cannot change.
- Let locks and limiters use their full requested wait: cap the final sleep to the remaining time and make the final acquisition attempt instead of stopping one interval early.
- Read database lock ownership from the writer. Inspect file locks without deleting replacement owners, release them under an exclusive ownership check, and reject unlinked handles during acquisition and release.
- Preserve
JsonSerializableattribute conversion and connection isolation in JSON:API resources. Collection loading runs on the first resource for the root and nested batches; later per-parent compilation cannot undo preloaded relationships. Default loading stays batched, and override detection caches only immutable per-class metadata. - Preserve zero-valued and backed-enum Mercure connection names. Keep synchronous Mercure worker-free while honoring uniqueness, commit timing and rescued cleanup failures; explicit outbox delivery uses the queue. Deferred direct publishing reads nested event objects at commit, while queued payloads retain dispatch-time capture.
- Release deferred job locks even when a pooled queue cannot be reacquired. Honor
ShouldRescuefor deferred broadcast failures across queues and failover, while propagating cancellation and retaining transaction ownership. - Resolve FTP installation with Swoole's built-in FTP functions. Add development adapter dependencies, verify the runtime capability in CI and document the application-root Composer declaration, Swoole build option and native-extension conflict. Published packages do not claim to provide the extension.
- Require FTP/SFTP adapter versions that support path-based MIME detection, and verify that the CI runtime exposes Swoole FTP without the conflicting native extension.
- Avoid quadratic replacement-array reindexing when formatting SQL errors with many bindings.
- Clarify that supported Laravel compatibility is behavioral and departures require evidence from compatible alternatives.
Formatting, source/type analysis, affected tests, Testbench and package-consumer checks pass. Targeted relationship and binding checks also pass on MySQL and PostgreSQL, with isolated Redis coverage for queue and limiter behavior.
[!NOTE]
Sync Laravel updates for queues, database, JSON:API, FTP, and locks
- Adds
Relation::updateRelatedKeys, which chunks related-key updates by the PDO binding limit, and uses it from BelongsToMany::touch and a new HasOneOrManyThrough::touch with binary-key encoding
- Fixes
Model::incrementOrDecrement / incrementOrDecrementEach to cast extra values for storage and track changes via syncIncrementedChanges and HasAttributes::syncChangesFrom
- Switches
Lock::block and concurrency/duration limiters to microsecond deadlines so the final sleep is capped to the remaining timeout; FileLock release and owner reads no longer delete replacement lock files, and DatabaseLock owner reads use the write PDO
- Adds synchronous Mercure broadcasting:
MERCURE_ASYNC config, BroadcastManager::dispatchSynchronousBroadcast with after-commit transactions and unique-lock handling, plus queue:forget accepting multiple IDs
- FTP/SFTP disks now support
detect_mime_type_using_path, use Swoole FTP (ext-ftp provided, not required), and the Redis bulk Lua script flushes jobs and notifications in groups of 100
- Risk: behavior changes are scattered across many call sites — check
BelongsToMany::touch scope reapplication, Connection::tryAgainIfCausedByLostConnection reconnect guard, CanBeOneOfMany join-model qualification, and UniqueBroadcastEvent UniqueFor attribute resolution
Macroscope summarized 5617484.
Summary by CodeRabbit
-
New Features
- Mercure broadcasts are synchronous by default, with an option to route them through the queue.
queue:forgetcan process multiple failed-job IDs in one command.- Scheduled-task failure events include elapsed runtime, and process timeouts support fractional seconds.
- FTP and SFTP disks can detect MIME types from filenames; JSON:API collections support requested relationship loading.
-
Bug Fixes
- Improved timeout accuracy for locks and concurrency limiters, database reconnection handling, and joined-query ordering.
- Improved relationship touching and binary attribute updates, and fixed handling of queue and JSON:API data.
-
Documentation
- Updated guidance for Mercure broadcasting, FTP setup, MIME detection, and failed-job removal.