Closed ScripterSugar closed 4 years ago
Hi. I found the bug on the mongoDB implementation method streamEventsByRevision.
If I call streamEventsByRevision like this
eventStore.streamEventsByRevision('28e7fc75-869b-486e-9482-f3230f4375b4', -1, -1);
It returns stream with data
{ _id: '5f23b2a84cb94b4294d0c9280', streamId: '28e7fc75-869b-486e-9482-f3230f4375b4', aggregateId: '28e7fc75-869b-486e-9482-f3230f4375b4', aggregate: 'User', context: '__default', streamRevision: 1, commitId: '5f23b2a84cb94b4294d0c928', commitSequence: 0, commitStamp: 2020-07-31T05:56:56.707Z, payload: { type: 'BALANCE_ADDED', data: '{"addedAmount":50}', issuer: '', eventId: '' }, position: null, id: '5f23b2a84cb94b4294d0c9280', restInCommitStream: 0, dispatched: false } { _id: '5f23b2aa4cb94b4294d0c9290', streamId: '28e7fc75-869b-486e-9482-f3230f4375b4', aggregateId: '28e7fc75-869b-486e-9482-f3230f4375b4', aggregate: 'User', context: '__default', streamRevision: 2, commitId: '5f23b2aa4cb94b4294d0c929', commitSequence: 0, commitStamp: 2020-07-31T05:56:58.235Z, payload: { type: 'BALANCE_ADDED', data: '{"addedAmount":50}', issuer: '', eventId: '' }, position: null, id: '5f23b2aa4cb94b4294d0c9290', restInCommitStream: 0, dispatched: false } { _id: '5f23bd0fa78f0c63007711ee0', streamId: '28e7fc75-869b-486e-9482-f3230f4375b4', aggregateId: '28e7fc75-869b-486e-9482-f3230f4375b4', aggregate: 'User', context: '__default', streamRevision: 3, commitId: '5f23bd0fa78f0c63007711ee', commitSequence: 0, commitStamp: 2020-07-31T06:41:19.332Z, payload: { type: 'BALANCE_ADDED', data: '{"addedAmount":50}', issuer: '', eventId: '' }, position: null, id: '5f23bd0fa78f0c63007711ee0', restInCommitStream: 0, dispatched: false } { _id: '5f23bd0fa78f0c63007711ee0', streamId: '28e7fc75-869b-486e-9482-f3230f4375b4', aggregateId: '28e7fc75-869b-486e-9482-f3230f4375b4', aggregate: 'User', context: '__default', streamRevision: 3, commitId: '5f23bd0fa78f0c63007711ee', commitSequence: 0, commitStamp: 2020-07-31T06:41:19.332Z, payload: { type: 'BALANCE_ADDED', data: '{"addedAmount":50}', issuer: '', eventId: '' }, position: null, id: '5f23bd0fa78f0c63007711ee0', restInCommitStream: 0, dispatched: false }
As you can see first event has omitted and last event has duplicated.
The test script scenario couldn't catch the issue as it only checks if length of returned events is appropriate..
I think I can create a PR for quick fixing this bug. Looking into it rn.
fixed in v1.15.5
Hi. I found the bug on the mongoDB implementation method streamEventsByRevision.
If I call streamEventsByRevision like this
It returns stream with data
As you can see first event has omitted and last event has duplicated.
The test script scenario couldn't catch the issue as it only checks if length of returned events is appropriate..
I think I can create a PR for quick fixing this bug. Looking into it rn.