Coder Social home page Coder Social logo

Comments (3)

renancaraujo avatar renancaraujo commented on July 22, 2024 1

The pub API has two potential sources for fetching the "latest" version on the packages endpoint:

  • The "latest" field on the packages, which will take the latest stable release, if none, the latest pre-release
  • A list with all versions, assuming that the list is ordered chronologically.

Some facts about this:

  • We cant trust the chronological order of release to define as being "up to date", especially when it is about pre-releases. One may have two pre-released tracks for the same version with interlacing release dates. Ex:
- 0.2.0-nicefeature.1 released Monday
- 0.2.0-awesomefeature.1 released Tuesday
- 0.2.0-nicefeature.2 released Wednesday

You wouldn't like to have people updating from awesomefeature.1 to nicefeature.2 since they may preview different features.

  • We cant trust pub-semver's compareTo to define the order of pre-releases. Since 0.2.0-awesomefeature.1 is considered precedent of 0.2.0-nicefeature.1 because of alphabetical order.

Proposal:

Add a boolean flag to isUpToDate to always return true if the running version is a pre-release since there is no safe way to define compare pre-releases.

from pub_updater.

renancaraujo avatar renancaraujo commented on July 22, 2024

This affects specifically cases where there is a stable release for that package.
For packages with only pre-releases, this won't happen.

The fix for this issue should maintain the behavior on the latter but fix the false positive on the former.

from pub_updater.

blaugold avatar blaugold commented on July 22, 2024

@renancaraujo Thanks for working on this! An approach to still support upgrading pre-release versions could be to allow users to pass in a sorting function for pre-release versions. WDYT?

from pub_updater.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.