Skip to content
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

Save events no firing (v3) #21

Open
KevinJump opened this issue Oct 7, 2022 · 1 comment
Open

Save events no firing (v3) #21

KevinJump opened this issue Oct 7, 2022 · 1 comment

Comments

@KevinJump
Copy link
Collaborator

When you save something with a handler it should trigger a save of the item to disk, for v3 this doesn't appear to be happening.

its not a major deal, if people are running and export or syncing via uSync.Complete but it should be there so we can keep in sync.

for example the PaymentMethodHandler should handle PaymentMethodSavedNotification and PaymentMethodDeletedNotification
but it doesn't fire.

guessing because we never actually register these via an EventHub?

but ?

All the handlers are in a collection that is loaded via uSync
We are implimenting IEventHandlerFor so i am not sure how we register them

    public class PaymentMethodHandler : VendrSyncHandlerBase<PaymentMethodReadOnly>, ISyncVendrHandler
        , IEventHandlerFor<PaymentMethodSavedNotification>
        , IEventHandlerFor<PaymentMethodDeletedNotification>

Guess it is a quick thing but not sure what it requires ?

@mattbrailsford
Copy link
Member

There should be some registrations register in a composer. See here for some docs on this https://vendr.net/docs/core/3.0.0/key-concepts/events/#registering-a-validation-event-handler

Looks like we do it an older way in Vendr.Deploy but this was probably for ease when we were targeting older versions https://github.com/vendrhub/vendr-deploy/blob/v3/main/src/Vendr.Deploy/Composing/VendrDeployComponent.cs#L133 but it at least lists what we should be handling

I’ll take a look on Monday though

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

No branches or pull requests

2 participants