Sync Laravel updates for queues, database, JSON:API and FTP
Merged
BI
19h ago+3204+3204+0123456789012345678901234567890123456789-183-183-012345678901234567890123456789
Laravel Updates
- Fix
touch()on through relationships by updating the related table through its selected IDs, preserving intermediate soft-delete constraints. - Batch Redis bulk-dispatch payloads and notifications together. Keep bounded buffers, mixed immediate/delayed ordering and exact completion counts.
- 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.
- Support
UniqueForattributes on broadcast events and make Mercure delivery synchronous by default, with an explicit async option. Update configuration and broadcasting documentation. - Preserve fractional process and idle timeouts supplied as
CarbonIntervalvalues. - Prevent queries run during reconnection from recursively reconnecting the same logical connection.
- Skip contextual container lookup when no contextual bindings are registered.
- Apply model casts to extra attributes supplied to increment and decrement operations.
- Check scheduler overlap locks without acquiring and releasing them.
- Reconcile fake-aware limiter timeout behavior and its regression coverage.
- Constrain both information-schema tables when inspecting MySQL and MariaDB foreign keys, avoiding work across unrelated databases.
- 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.
- Include elapsed runtime in failed scheduled-task events and document its units and nullable value.
- 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.
- Qualify the deleted column when restoring joined models.
- Add
detect_mime_type_using_pathto FTP and SFTP disks, with adapter coverage and documentation. - Allow
queue:forgetto process multiple IDs, report each result and return failure if any ID is missing. - 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.
Summary by cubic
Syncs Hypervel with the latest Laravel updates across queues, database, JSON:API, broadcasting, filesystem, and scheduling.
- Fixes
touch()on through and belongs-to-many relations, preserving soft-delete scopes and binary keys and batching scoped updates within the statement binding limit; fixes self-referencing one-of-many queries, which no longer inherit the outer model alias, and restore of joined models. - Batches Redis bulk queue payloads and notifications together while preserving ordering and failure semantics.
- Dispatches Mercure broadcasts synchronously by default with an explicit async option, supports
UniqueForattributes, and claims deferred dispatch locks before reacquiring a pooled queue so lease failures do not strand ownership. - Adds elapsed runtime to
ScheduledTaskFailedevents and fractionalCarbonIntervalprocess timeouts. - Qualifies implicit
latest()/oldest()timestamps on joined queries and constrains both MySQL foreign-key inspection tables. - Applies model casts and binary bindings to extra increment/decrement attributes and re-runs public
syncChanges()overrides during saves. - Allows
queue:forgetto remove multiple failed jobs. - Adds
detect_mime_type_using_pathto FTP and SFTP disks. - Reads database lock ownership from the write connection and inspects file locks without deleting a replacement owner, rejecting acquisition, release, and refresh through an unlinked handle.
- Keeps the reconnect guard active during lease announcements and lets locks/limiters use their full requested wait.
- Makes
Str::replaceArray()linear when formatting queries with many bindings.
Migration
- FTP disks now use Swoole's bundled FTP functions; build Swoole with
--enable-swoole-ftpand declare"provide": {"ext-ftp": "*"}in your application'scomposer.json. FTP and SFTP adapters must beleague/flysystem-ftporleague/flysystem-sftp-v33.13 or newer.
[!NOTE]
Sync Laravel updates for queues, database, JSON:API, and FTP adapters
- Adds synchronous Mercure broadcasting: non-unique events on synchronous Mercure connections dispatch without a queue worker, with after-commit and rollback handling, uniqueness locks, and a new
MERCURE_ASYNC config option (broadcasting.php, BroadcastManager.php)
- Adds
touch() and allRelatedIds() to HasOneOrManyThrough and reworks BelongsToMany.touch to share Relation.updateRelatedKeys, which now splits related-key updates into chunks that respect the PDO binding limit and preserves binary key binding and removed global scopes (HasOneOrManyThrough.php, Relation.php)
queue:forget now accepts multiple failed-job IDs and continues past IDs that are not found, returning failure if any ID is missing (ForgetFailedCommand.php)
- Hardens file locks:
FileStore refuses operations when the opened file was deleted, FileLock.release deletes only when the owner matches, DatabaseLock reads the write PDO, and Lock.block/limiter block use microsecond deadlines so the final sleep is capped to the remaining timeout
- FTP disks now use Swoole FTP support: adds Flysystem FTP/SFTP v3 dependencies (conflicts below 3.13), removes the
ext-ftp requirement, and supports detect_mime_type_using_path for FTP and SFTP disks (composer.json, FilesystemManager.php)
- Risk:
Connection.tryAgainIfCausedByLostConnection gains a reconnecting flag so a lost-connection error during an in-progress reconnect no longer triggers a second reconnect; check Connection.php if you rely on nested reconnect behavior. Model increment/decrement now prepare extra values through casts and binary preparation before writing and change how syncChanges values are reported, and Builder.latest/oldest qualify the default created-at column for queries with joins
Macroscope summarized 5617484.
Summary by CodeRabbit
-
New Features
- Mercure broadcasts publish synchronously by default, with an option to queue them asynchronously.
queue:forgetcan process multiple failed-job IDs in one command.- Scheduled-task failure events include execution time when available, and process timeouts support fractional seconds.
- FTP and SFTP disks can infer MIME types from filenames. JSON:API responses batch-load requested relationships across collections.
- Has-many-through relationships support touching related records.
-
Bug Fixes
- Improved timeout handling for locks and concurrency limiters, database reconnection, relationship queries, and cache lock ownership.
- Improved deferred broadcast and queue handling, including failure recovery.
-
Documentation
- Updated guidance for broadcasting, FTP setup, scheduled-task runtime, and forgetting failed jobs.