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

PersistentSubscriptionSettings.fromRevision only accepts START and bigint #152

Closed
bjorndown opened this issue Apr 8, 2021 · 3 comments · Fixed by #154
Closed

PersistentSubscriptionSettings.fromRevision only accepts START and bigint #152

bjorndown opened this issue Apr 8, 2021 · 3 comments · Fixed by #154

Comments

@bjorndown
Copy link

I already asked this at https://discuss.eventstore.com/t/persistentsubscriptionsettings-fromrevision-only-accepts-start-and-bigint/3206 but so far I have not gotten any answers and it is important to us.

Could you explain why PersistentSubscriptionSettings.fromRevision [1] cannot be set to END ? In most cases we would not want to consume all events from the beginning. Would using ReadRevision [2] not make more sense? or is it that way because it is safer to set it to an explicit revision if we don’t start from the beginning?

Judging from the implementation [3] it does not look like an oversight.

We will soon be migrating our existing ESDB to ESDB cloud using https://replicator.eventstore.org. The replicator does not copy the persistent subscriptions and rather than specifying the explicit revision we would like them to start at the end. Also the server still seems to understand -1 for startFrom so I don't see why the client does not.

[1] https://github.com/EventStore/EventStore-Client-NodeJS/blob/master/src/utils/persistentSubscriptionSettings.ts#L17
[2] https://github.com/EventStore/EventStore-Client-NodeJS/blob/master/src/types/index.ts#L35
[3] https://github.com/EventStore/EventStore-Client-NodeJS/blob/master/src/persistentSubscription/createPersistentSubscription.ts#L54

@George-Payne
Copy link
Member

George-Payne commented Apr 8, 2021

Hi Björn,

Thank you for the thorough issue, it is indeed an oversight.

The fix is here:
#154

and I'll make a patch release once its made it through reviews / QA

If you need a fix before then, you can work around it by setting the revision as so:

persistentSubscriptionSettingsFromDefaults({
    fromRevision: BigInt("18446744073709551615"),
})

@bjorndown
Copy link
Author

That is great, thanks!

@George-Payne
Copy link
Member

This is now available in 1.1.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants