Category: mercure

Command and Controller shared data, using Symfony and Mercure for realtime?

1. The controller. I have a Controller Action (than is an API), which loads currency rates from the database, does some processing, and returns a result in JSON, like this: { “EUR”: “186.34”, “GEL”: “646.77”, “PLN”: “839.16”, “RUB”: “14532.60”, “USD”:…

Request with Symfony HttpClient returns code 0, when the same request with postman works fine

I have a weird problem where a request I make (to my mercure hub) with postman works fine, however the Publisher class (from the Symfony mercure bundle), which uses the Symfony HttpClient will yield in a response code 0. According…

How to make API Platform autodiscovery mechanism for Mercure hub work with Docker image?

I’ve developped a demo project to illustrate a presentation I’m doing about the Mercure protocol, in which I also use API Platform. I had used the autodiscovery mechanism to retrieve the Mercure hub url (API Platform sends a Link header…

Symfony / Mercure question : 2 users with single self targets can both see each other’s supposedly looped messages

I made a chat page where the logged in user should be able to see only his own messages thru single targets. However, every user can see every other user’s supposedly self-intended (looped) messages. Every logged in user send his…

Why is Symfony’s autowire giving me the debug-version instance of a class? Can I bypass this to get the regular version in dev mode?

I have a problem with the autowiring of SymfonyComponentMercurePublisher. Instead I am being autowired SymfonyComponentMercureDebugTraceablePublisher by error. How do I fix this? Error message is: Argument 1 passed to AppControllerPublisherController::index() must be an instance of SymfonyComponentMercurePublisher, instance of SymfonyComponentMercureDebugTraceablePublisher given,…