Skip to content
This repository was archived by the owner on Aug 15, 2024. It is now read-only.
This repository was archived by the owner on Aug 15, 2024. It is now read-only.

Major change in stream expected version? #331

Open

Description

@semion-akimtsev

Hi @damianh ,

We have recently tried to upgrade to one of 1.2.x pre-release versions and got some unexpected behavior due to this change here

public const int NoStream = -3;
compared to version 1.1.x.
So it looks like there should be a major version change. What versioning strategy is applied to this repo?

Activity

  1. yreynhout commented on Nov 1, 2019

    @yreynhout
    Contributor

    Are you using 1.2.x's ExpectedVersion with an older client (e.g. 1.1.x)? Or are you shipping the constant as part of another lib which you can't upgrade? What was the unexpected behavior (I suspect the reuse of -1)?

  2. semion-akimtsev commented on Nov 1, 2019

    @semion-akimtsev
    Author

    Well, as ExpectedVersion is an integer, the code which relies on this public contract made some assumptions about -1. After it was switched to 1.2.0-beta.6 some of the checks started to return different results.

  3. yreynhout commented on Nov 3, 2019

    @yreynhout
    Contributor

    I've never really liked these as a constant nor as an integer - it should be opaque to the consumer and nobody should ever base decisions on the underlying value - it's a deficiency in SSS's type system. Alas, that ship has sailed for SSS, and so here we are.

  4. thefringeninja commented on Nov 4, 2019

    @thefringeninja
    Contributor
  5. semion-akimtsev commented on Nov 4, 2019

    @semion-akimtsev
    Author

    For now it looks to me that we cannot move on with this version as this is a breaking change, because a public API has been changed in a non-backwards compatible way. And it is not captured in this library's version if I would assume that it uses semantic versioning.

    Use a value object in your application code and translate
    before you call sql stream store

    Could you please give an example?
    IMO, since the API exposes a constant, I cannot imagine a way of wrapping it with anything which would not use an if() function of some sort (or directly expose the same value with a different name).

    Aside of that, the ExpectedVersion type/contract mixes unrelated concerns together by introducing EmptyStream and NoStream. These have no relation to version. So I would argue that there is a need to introduce an entity called Stream which would have a set of properties exposed like bool=IsEmpty. NoStream does not fit into both approaches as it is neither a version nor a stream status, but probably is a part of a stream "accessor" interface.

  6. thefringeninja commented on Nov 4, 2019

    @thefringeninja
    Contributor
  7. yreynhout commented on Nov 4, 2019

    @yreynhout
    Contributor

    I agree this is a breaking change in that an existing value was (re)used for a different purpose and constants being copied and embedded into consumers can make this painful. You can only move to this version if you are willing to recompile, yes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions