Skip to content

[draft] feat(mercure): #7087 - Make Mercure use provider if available when publishing updates #7171

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

mirepyk
Copy link

@mirepyk mirepyk commented May 23, 2025

Q A
Branch? main
Tickets Closes #7087
License MIT

This is a Draft. It's missing unit tests to be mergeable I guess.
Until then, we can use the reproducer if to test the behaviour, it has an interface for that.

Reproducer for the issue : https://github.com/mirepyk/api-platform-reproducer-issue-7087-feat-mercure-state-provider

@mirepyk mirepyk marked this pull request as draft May 23, 2025 17:58
@mirepyk mirepyk force-pushed the feat/7087-mercure-use-state-provider branch from 275cfab to 12c8539 Compare May 23, 2025 18:06
@@ -65,7 +66,7 @@ final class PublishMercureUpdatesListener
/**
* @param array<string, string[]|string> $formats
*/
public function __construct(ResourceClassResolverInterface $resourceClassResolver, private readonly IriConverterInterface $iriConverter, ResourceMetadataCollectionFactoryInterface $resourceMetadataFactory, private readonly SerializerInterface $serializer, private readonly array $formats, ?MessageBusInterface $messageBus = null, private readonly ?HubRegistry $hubRegistry = null, private readonly ?GraphQlSubscriptionManagerInterface $graphQlSubscriptionManager = null, private readonly ?GraphQlMercureSubscriptionIriGeneratorInterface $graphQlMercureSubscriptionIriGenerator = null, ?ExpressionLanguage $expressionLanguage = null, private bool $includeType = false)
public function __construct(ResourceClassResolverInterface $resourceClassResolver, private readonly IriConverterInterface $iriConverter, ResourceMetadataCollectionFactoryInterface $resourceMetadataFactory, private readonly SerializerInterface $serializer, private readonly array $formats, private readonly ContainerInterface $container, ?MessageBusInterface $messageBus = null, private readonly ?HubRegistry $hubRegistry = null, private readonly ?GraphQlSubscriptionManagerInterface $graphQlSubscriptionManager = null, private readonly ?GraphQlMercureSubscriptionIriGeneratorInterface $graphQlMercureSubscriptionIriGenerator = null, ?ExpressionLanguage $expressionLanguage = null, private bool $includeType = false)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could inject directly the ReadProvider instead of injecting a container? Also please add it as last argument.

I'd also probably inject the SerializeProcessor instead of writing again the whole context/serialization logic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[feat] Mercure doesn't use state provider when publishing updates
2 participants