nestjs-geteventstore icon indicating copy to clipboard operation
nestjs-geteventstore copied to clipboard

Bug: Events are not Read

Open kodeine opened this issue 4 years ago • 13 comments

@AlexandreDecollas @Vinceveve

I wasnt able to read the events in my app i thought my app broke after updating to use latest version of this package but then i gave a try running examples in this package and the bug actually exists.

Events are being written properly but not Read. Following is the output from examples, notice the saga never runs because it couldn't read event.

image

and following is when i just use registerReadBus

image

*updated nestjs-geteventstore 5.0.3 <-- read's not being done. 4.1.1 <--- reads work fine!

node -v v16.10.0

npm -v 7.24.0

Event Store 21.6.1.0

kodeine avatar Nov 26 '21 03:11 kodeine

@jdharandas would you be able to help me figure this out?

kodeine avatar Nov 26 '21 14:11 kodeine

Hello, @kodeine. It seems that the WriteEventsPrepublishService is being included with the read module, but it shouldn't. This is being fixed in 5.1.x as a side effect, as we have removed that dependency for that service, but we should patch it in 5.0.* too.

jdharandas avatar Nov 29 '21 11:11 jdharandas

@jdharandas i tried with the new PR #100 you have but events are still not being read.

kodeine avatar Dec 13 '21 01:12 kodeine

@jdharandas any idea when there will be a fix for reading events on latest version?

kodeine avatar Dec 22 '21 01:12 kodeine

@kodeine I won't be able to take a look at this until January the 10th (more or less)

jdharandas avatar Dec 22 '21 09:12 jdharandas

Hello,

is there any updates on this?

kodeine avatar Jan 27 '22 03:01 kodeine

@AlexandreDecollas @Vinceveve @jdharandas Any idea when this will be fixed? Also, class EventService is not exportable so if we need to use getProjectionState method from EventStore we cannot.

kodeine avatar Feb 11 '22 00:02 kodeine

Hi here, I cannot reproduce the error, could you provide a example code that reproduce this issue please? (btw, I added all missing exports on this lib)

AlexandreDecollas avatar Mar 03 '22 14:03 AlexandreDecollas

@AlexandreDecollas so i ran the examples/ folder again and following is the output. I know its related to the DTO but looks like example folder isnt working.

EDIT PR #112 fixes this DTO issue but subscriptions are still not working

image image image image image

kodeine avatar Mar 23 '22 21:03 kodeine

@AlexandreDecollas @Vinceveve After fixing the dto issue, subscriptions are not working and events are not being read. image

Root case is payload is coming as undefined, image

also, persistentSubscription.on('data'... is suppose to return a single object not two.

image

here this.eventBus comes undefined as well. image

kodeine avatar Apr 10 '22 01:04 kodeine

@jokesterfr since you added the label as a bug, were you able to test this at your end as well?

kodeine avatar Apr 11 '22 04:04 kodeine

@kodeine 5.x is not really working, I have tested it and it has a lot of bugs (not only this one). As @AlexandreDecollas is the "owner" of this version, I will try to work with him to create the fixes, but at this moment I am working with @Rzial in a 6.x that fixes those bugs and adds new functionalities (fex: write event bus middlewares).

jdharandas avatar Apr 11 '22 08:04 jdharandas

@jdharandas thank you for the update, i was going crazy testing this i thought i was making some mistake unknowingly but then i started digging into the code and found issues. Thanks a lot for your input. I will wait for v6, is it going to be in this repo or somewhere else? I actually was going live with my product and wanted to make sure i am on latest versions but seems like i cant use eventstore 20.10.x. If you have any timeline for v6 or fixes for this v5, please do let me know. Once again, thank you again.

kodeine avatar Apr 12 '22 16:04 kodeine