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

NextVersion #2

Closed
samidalouche opened this issue Sep 7, 2016 · 2 comments
Closed

NextVersion #2

samidalouche opened this issue Sep 7, 2016 · 2 comments

Comments

@samidalouche
Copy link

samidalouche commented Sep 7, 2016

Hi,

for some reason, calling NextVersion does not seem to start reading at the given offset.

Let's say I have 5 events in a stream (EventStore 3.8.x), and I execute

     requestReader := commandListener.EventStoreClient.NewStreamReader(requestsStreamName)
     requestReader.NextVersion(3)

     for requestReader.Next() {
         if requestReader.Err() != nil {
             panic("error")
    } else {
            log.WithFields(logrus.Fields{
        "currentEvent": requestReader.EventResponse().Event.EventNumber,
     }).Info("Current Event")
        }
     }

I get the output :

Current Event currentEvent=0
Current Event currentEvent=1
Current Event currentEvent=2
Current Event currentEvent=3

In addition, if I pick a NextVersion higher than the default page size (20), it is not restarting from 0.

I can see that there is an automated test asserting that this works, but for some reason running the tests complains on my machine about the internal uuid package.

@samidalouche
Copy link
Author

samidalouche commented Sep 7, 2016

After recreating my environment (glide, ...), it seems that things are now working, so I may have run with an older version, or something like that... In any case, it seems to work now...

BTW, do you have setup instructions to explain how to run the unit tests? It would be useful to reproduce issues and report issues

@jetbasrawi
Copy link
Owner

jetbasrawi commented Sep 8, 2016

Hi sami, sorry I was travelling and only just seen your issue.

Glad you got it sorted.

To run unit tests, you will need to get the dependencies.

https://github.com/jetbasrawi/go.geteventstore.testfeed
and
https://gopkg.in/check.v1

After that it should be just the usual go test

Do let me know if you have any further issues trying to run the unit tests.

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