[2.x] fix: Unwrap RoutingQueue when identifying the queue driver - #4855
Merged
Conversation
The queue connection is wrapped in a RoutingQueue (#4853) so pushes can be routed by job class. identifyQueueDriver() derived the driver name from the connection's class, so it began reporting 'routing' instead of the real backend (redis/database/sync) in `flarum info` and the admin dashboard. Unwrap a RoutingQueue via its public getDriver() before reading the class name, so the reported driver reflects the actual backend again.
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.
Why
#4853 wraps the queue connection in a
RoutingQueuesopush()can be routed by job class.ApplicationInfoProvider::identifyQueueDriver()derives the driver name from the connection's class name, so with the wrapper in place it now reportsroutinginstead of the real backend (redis/database/sync).This is visible on every 2.x site:
It also surfaces on the admin dashboard, and it breaks downstream code that keys off the reported driver — e.g. fof/horizon relabels
redis→Redis + Horizonand gates its admin controls on that, so those controls silently disappear.What
Unwrap a
RoutingQueuevia its publicgetDriver()before reading the class name, so the reported driver reflects the actual backend again:Tests
ApplicationInfoProviderTestgains:queue_driver_is_derived_from_the_connection_class— a bareSyncQueuereportssync.queue_driver_reports_the_real_driver_when_wrapped_in_a_routing_queue— aSyncQueuewrapped in aRoutingQueuestill reportssync, notrouting.The
provider()helper takes an optional queue instance so a specific connection can be injected.Full
ApplicationInfoProviderTestgreen (8 tests). Verified live:php flarum inforeportsredisagain on a redis-backed stack.Regression from
#4853 (the
RoutingQueueconnection wrapper).