Closed byronigoe closed 2 years ago
@byronigoe
Thanks for the PR!
it seems reasonable to choose the latest but not more specific version. We have not used the MS official service before so I am not sure about the behavior of official service, but I checked the code-push-cli doc and didn't find any information about more specific target version should be prefered to version range.
As regards the changes here, I'll need to double check the rollback & prompt cases, not sure about whether sorting by created_at
works for them.
@byronigoe
It looks like it always create new packages for rollback & prompt cases, I guess use created_at
is fine.
Would you mind helping with the lint issue? I'll merge this PR once it passes CI.
btw: since we only need the last array item, maybe _.last(_.sort(...))
can be faster that .reverse()[0]
. It might be even better to sort and findOne
with sql query, but I suppose current solution is good enough for addressing the issue itself.
Download the most recently uploaded package that matches the version instead of always choosing the most specific deployment