Closed enumag closed 5 years ago
In case you don't see the difference compare
link: 0@CodeListsManagement.ZipCode-7ad864ae-88bc-d948-87ce-973e0fbb8a73
event: 0@everything
with
link: 0@everything
event: 0@CodeListsManagement.ZipCode-7ad864ae-88bc-d948-87ce-973e0fbb8a73
These should be the same since there is no difference in my code that handles the ResovedEvent.
EDIT ... I might have accidantly swapped the results. Still doesn't change the fact that there is a bug.
EDIT 2 Yeah they were swapped, fixed now.
Btw. I think we should change the docblocks of ResolvedEvent. I still don't understand what is supposed to be in event/link/originEvent after reading them.
Basically we have some events in many separate streams, right? Let's call these X
events (data of X event is typically a json). Then we have a projection that aggregates those streams and creates a new streams with links - let's call these Y
events (data of Y event is identifier of a X event).
Now ResolvedEvent should contain both X
and Y
event but I'm not sure which method of ResolvedEvent should return X
and which should return Y
.
ResolvedEvent::event()
- imo this should return X
ResolvedEvent::link()
- imo this should return Y
ResolvedEvent::originalEvent()
- imo this should return X
againIt definitely doesn't work that way though because in current implementation both link()
and originEvent()
return the same thing.
What is your understanding? Can you give me your pairing of event/link/originalEvent
to X/Y
? If you do I think I can send a PR to solve both the docs and the bugs.
From gitter: intended pairing is
ResolvedEvent::event()
- XResolvedEvent::link()
- YResolvedEvent::originalEvent()
- Yfixed by ed752df
I insert data into EventStore and then read the same data by two different ways. There is still something wrong in the link/event distinction. The results should be the same but in fact link/event is swapped in one of them.
I'm not sure which is correct. Anyway there is a bug in one of the prooph repos somewhere. I can dig further but I need a confirmation what is correct first.
Code A: (using HTTP client)
Code A result:
Code B: (part of my persistent subscription testing, using TCP client)
Code B result: