Actyx event not firing? (node/TS)

Hello everyone,

we have the following situation:

Fetch external request with node-fetch.
If the response is OK (200), then do:

const bodyContent: ResponseType = await result.json();
enqueue<BookingSuccess>(baseTag.and(BookingTags.erpBookingSuccess.withId(booking.orderId)), {
    eventType: "transmissionSuccessful",
    id: id,
    booking: booking,
    confirmationCounter: bodyContent.confirmationCounter,

For some reason the event does not get created on our customers machine.
Locally, this code does work.
From the logs we can tell that the code reaches this part (logSomething() method).
Similar code is also used in other parts of the application without any problems.
Is there any circumstance in which the event does not get created?
I’ve tried wrong parameters or even omitting some, but the event still gets created on my pc.
the await result.json() line shouldn’t take long, it’s just two ids that are stored in the result body,
which was fetched before.
Any ideas?

The main mechanism how events passed to enqueue might not be emitted is if the subsequent code of the state handler function (i.e. the ... in your snippet) throws an exception.

Another candidate for investigation is how exactly you detect that the event is not created — is there perhaps an isLocal qualifier in the query? Can you see the event when connecting to the node where it should be emitted using the Node Manager?

Sorry for the late response.
We concluded that the event was not created because we couldn’t find it in the node manager query.
We queried localhost, where the event should have been created.
There is not much code after the event enqueue. Just statements ending, e.g. curly brackets.
Currently we think the .json() might be the reason. We want to log in between .json(), enqueue and after the event enqueue next time we get a chance.
I’ll update this post afterwards to let you know.

Today we added some more logs around, before and after the enqueue call.
As far as I can tell, the code is running as expected, except the event not firing.
The .json() call is also not delaying the execution.
At the moment we are clueless about why the event is not fired.

Hmm, that’s weird. In this case I’d need to see all of the relevant code to be able to help. If you don’t consider it appropriate for this public forum you’re welcome to send it via DM.

Another possible explanation: are you certain that the Pond that should be emitting this event keeps running long enough to do so? (i.e. no page reload or node.js process termination intervenes?) It might also help to see the logs around the time when this happens.

I’ve sent you a DM. Thanks in advance for the fast response!