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

FindPackagesById returns a prerelease even when not configured to do so #8

Closed
perlun opened this issue Nov 29, 2013 · 4 comments
Closed

Comments

@perlun
Copy link

perlun commented Nov 29, 2013

Hi,

This URL:
GET /i/nuget/FindPackagesById()?$filter=IsLatestVersion&$top=1&id='uxFactory.Wpf' HTTP/1.1

(which is in fact calling /i/api/odata/FindPackagesById* since I rewrite the URL using Helicon Ape)

...gives the following result:

HTTP/1.1 200 OK
Cache-Control: no-cache
Content-Length: 3269
Content-Type: application/atom+xml;charset=utf-8
Server: Microsoft-IIS/7.5
DataServiceVersion: 2.0;
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
X-Powered-By: ASP.NET
Date: Fri, 29 Nov 2013 08:53:37 GMT

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<feed xml:base="https://some.server.net/i/api/odata/" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns="http://www.w3.org/2005/Atom">
  <title type="text">FindPackagesById</title>
  <id>https://some.server.net/i/api/odata/FindPackagesById</id>
  <updated>2013-11-29T08:53:37Z</updated>
  <link rel="self" title="FindPackagesById" href="FindPackagesById" />
  <entry>
    <id>https://some.server.net/i/api/odata/Packages(Id='uxFactory.Wpf',Version='2013.11.0-pre1')</id>
    <title type="text">uxFactory.Wpf</title>
    <summary type="text"></summary>
    <updated>2013-11-26T15:02:12Z</updated>
    <author>
      <name>eCraft</name>
    </author>
    <link rel="edit-media" title="DataServicePackage" href="Packages(Id='uxFactory.Wpf',Version='2013.11.0-pre1')/$value" />
    <link rel="edit" title="DataServicePackage" href="Packages(Id='uxFactory.Wpf',Version='2013.11.0-pre1')" />
    <category term="NuGet.Lucene.Web.DataServices.DataServicePackage" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
    <content type="application/zip" src="https://some.server.net/i/api/packages/uxFactory.Wpf/2013.11.0-pre1/content" />
    <m:properties xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices">
      <d:Version>2013.11.0-pre1</d:Version>
      <d:Title m:null="true"></d:Title>
      <d:Owners>eCraft</d:Owners>
      <d:IconUrl m:null="true"></d:IconUrl>
      <d:LicenseUrl m:null="true"></d:LicenseUrl>
      <d:ProjectUrl>http://some.server.net/uxfactory</d:ProjectUrl>
      <d:DownloadCount m:type="Edm.Int32">0</d:DownloadCount>
      <d:RequireLicenseAcceptance m:type="Edm.Boolean">false</d:RequireLicenseAcceptance>
      <d:Description>uxFactory.Wpf. Functionality for building uxFactory applications that target the WPF platform.</d:Description>
      <d:ReleaseNotes m:null="true"></d:ReleaseNotes>
      <d:Created m:type="Edm.DateTime">2013-11-26T15:02:12.0342Z</d:Created>
      <d:Published m:type="Edm.DateTime">2013-11-26T15:02:12.0342Z</d:Published>
      <d:Dependencies>uxFactory.Core:[2013.11.0-pre1]:|uxFactory.Controls:[2013.11.0-pre1]:</d:Dependencies>
      <d:PackageHash>2GgS1wP2GCXqoK0yJ62/rgytVikNoYbhbSiev/QUDrYACFv/K8FTNAo15I/CP3ITUqP4UasiCin17WVbphih7w==</d:PackageHash>
      <d:PackageHashAlgorithm>SHA512</d:PackageHashAlgorithm>
      <d:PackageSize m:type="Edm.Int64">7873</d:PackageSize>
      <d:Copyright m:null="true"></d:Copyright>
      <d:Tags xml:space="preserve"> uxFactory mvvm wpf framework </d:Tags>
      <d:IsAbsoluteLatestVersion m:type="Edm.Boolean">true</d:IsAbsoluteLatestVersion>
      <d:IsLatestVersion m:type="Edm.Boolean">true</d:IsLatestVersion>
      <d:IsPrerelease m:type="Edm.Boolean">true</d:IsPrerelease>
      <d:Listed m:type="Edm.Boolean">true</d:Listed>
      <d:VersionDownloadCount m:type="Edm.Int32">0</d:VersionDownloadCount>
      <d:Score m:type="Edm.Single">0</d:Score>
      <d:Summary m:null="true"></d:Summary>
    </m:properties>
  </entry>
</feed>

This is very bad since it means that our users will get a prerelease, without asking for it... The standard NuGet.Server works correctly in this regard. Any ideas?

@chriseldredge
Copy link
Owner

Thanks for reporting. This appears to be due to the (badly named) property IsLatestVersion being treated differently in Klondike. Evidently this property is true for the highest non-pre-release version of a package.

@chriseldredge
Copy link
Owner

Cross reference themotleyfool/NuGet.Lucene#1

@chriseldredge
Copy link
Owner

Fixed in NuGet.Lucene, will close this issue after upgrading the dependency.

@chriseldredge
Copy link
Owner

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

No branches or pull requests

2 participants