Closed fabriziosestito closed 2 years ago
I am trying to integrate spear with commanded
Sweet! Thanks for working on that š
Is there any reason why the revision needs to be
>= 1
while mapping the expectations?
I was probably thinking at the time that if you wanted to expect 0 you could use :empty
but I don't see a problem with expecting 0 now that you mention it. Would you like to submit a PR to change that guard? I think having it be revision >= 0
would be my preference rather than just removing it - that field in the protobuf definitions is an unsigned int so I would like to protect against negative values https://github.com/EventStore/EventStore/blob/2604dea053a394864d94acdd48d90929cac30601/src/Protos/Grpc/streams.proto#L144
@the-mikedavis thanks for the fast answer, I baked a small PR as you suggested. I see the same guard being used for the batch append requests: https://github.com/fabriziosestito/spear/blob/85c0d6e9319c2e1b9caa8fd8c4c9d5a42971fa91/lib/spear/writing.ex#L138
Should we change this one as well?
Oh yeah let's allow 0 there as well š
@the-mikedavis force-pushed, done!
I am trying to integrate spear with commanded by strangling the Extreme library from the extreme_adapter.
Appending works, but I realized some test was not passing due to the
expect: 0
being ignored. The test tries to append 3 events and then it asserts that appending expecting arevision: 0
returns an error. Other assertions are true with revisions>= 1
Here is the test for reference:
where:
This line seems to be the culprit: https://github.com/NFIBrokerage/spear/blob/9c8041abbd33ab2093f33805fbece6f80efd1dce/lib/spear/writing.ex#L72 Removing the guard seems to do the trick.
Is there any reason why the revision needs to be
>= 1
while mapping the expectations?Thanks in advance!