Implement queued listener mode for Facebook pixel events#1
Implement queued listener mode for Facebook pixel events#1rtraselbd merged 7 commits intorevoltify:mainfrom
Conversation
…date middleware behavior
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request enhances the Facebook Pixel integration by introducing a configurable 'queued listener mode'. This allows for flexible event processing, enabling asynchronous handling of pixel events via a queue to improve application performance, or maintaining synchronous processing for immediate feedback. The changes span configuration, event listeners, middleware, and service providers, all thoroughly validated with new test cases to ensure robust operation in both modes. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces a new queued_listener_mode configuration to control whether Facebook Pixel events are processed asynchronously via a queue or synchronously. This involved modifying the FacebookTrackingMiddleware and SendPixelEvent listener to respect this new mode, and updating the PixelifyServiceProvider for dependency injection. The feature tests were also refactored to cover both queued and synchronous modes. However, critical issues were identified regarding configuration key mismatches in both the service provider and the tests, which would prevent the new feature from functioning as intended and the tests from accurately validating it. Additionally, there's an opportunity to improve test maintainability by reducing duplication using Pest's datasets.
There was a problem hiding this comment.
Pull request overview
Adds a configurable “queued listener mode” to control whether Facebook Pixel events are processed asynchronously (queued) or synchronously, wiring the setting through the service provider, listener, middleware, and feature tests.
Changes:
- Introduces a new config option for queued vs sync processing.
- Updates
SendPixelEventto implement conditional queueing viaShouldQueue+shouldQueue(). - Updates
FacebookTrackingMiddlewareto skip tracking cookie handling when queued mode is enabled, and expands tests to cover both modes.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
config/pixelify.php |
Adds queued_listener_mode config/env toggle for queued vs sync behavior. |
src/PixelifyServiceProvider.php |
Adds contextual DI to inject the queued-mode flag into the listener and middleware. |
src/Listeners/SendPixelEvent.php |
Implements conditional queueing based on injected config flag. |
src/Http/Middleware/FacebookTrackingMiddleware.php |
Conditionally runs tracking-cookie logic only in sync mode. |
tests/Feature/PixelifyTest.php |
Splits tests into queued vs sync mode blocks and adds assertions for listener/middleware behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…php to preserve backward compatibility
… for listener modes
…figuration in favor of direct config access
This pull request introduces a configurable "queued listener mode" for handling Facebook Pixel events, allowing you to choose between synchronous and asynchronous processing of pixel events. The mode is controlled via a new configuration option and is respected throughout the event listener, middleware, and service provider. Comprehensive tests are added to verify both queued and synchronous behaviors.
Configuration and Dependency Injection:
queued_listener_modeoption topixelify.phpconfig, allowing developers to toggle between queued (asynchronous) and synchronous event handling for Facebook Pixel events.PixelifyServiceProvider) to inject the appropriate mode ($isQueued) into both theSendPixelEventlistener andFacebookTrackingMiddlewarebased on the config setting.Listener and Middleware Updates:
SendPixelEventto implementShouldQueueand respect theisQueuedflag, so it conditionally queues events based on configuration.FacebookTrackingMiddlewareto accept theisQueuedflag and only handle tracking synchronously when not in queued mode, improving performance and flexibility.Testing Enhancements: