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

mostRecentPublishedMessageId() returns the first PublishedMessageId instead of the last #16

Open
dadeky opened this issue Aug 12, 2016 · 2 comments

Comments

@dadeky
Copy link

dadeky commented Aug 12, 2016

In the class Ddd\Infrastructure\Application\Notification\DoctrinePublishedMessageTracker on line 18 the code should be replaced with: $messageTracked = $this->findOneBy(array('typeName'=>$aTypeName), array('trackerId'=>'DESC')); in order to return the last PublishedMessageId

@martinezdelariva
Copy link
Contributor

That's not needed due typeName is unique in PublishedMessageTracker table.
The goal is track only the last id per typeName not the history of tracks.

@dadeky
Copy link
Author

dadeky commented Aug 16, 2016

OK, but if that's the design, then there is a problem with the class Ddd\Infrastructure\Application\Notification\DoctrinePublishedMessageTracker on the line 39 where the $publishedMessage = $this->find($aTypeName); method never finds the PublishedMessage object in the repository and always creates a new one in the persistence and the result is multiple records for one typeName in the event_published_message_tracker table. The find method expects the primary key and not the $aTypeName.

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