Uploaded image for project: 'Picard'
  1. Picard
  2. PICARD-421

Releases in private collections are not shown as being in them

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 2.1
    • 1.2, 2.0.4
    • Other
    • None

      When I load a release that I do have in a private collection the context menu doesn't show that it's in the collection. I can add it to the collection from the context menu and the release count for that collection in Picard gets incremented but nothing changes on the website.

          [PICARD-421] Releases in private collections are not shown as being in them

          This is still an issue in latest Picard. MBS-6152 was fixed, but Picard needs to explicitly set inc=user-collections. Fix in:

          https://github.com/metabrainz/picard/pull/1052

          Philipp Wolfer added a comment - This is still an issue in latest Picard. MBS-6152 was fixed, but Picard needs to explicitly set inc=user-collections. Fix in: https://github.com/metabrainz/picard/pull/1052

          Yeah, I wasn't proposing the user-tags thing as a hack, just mentioning it to help anyone looking into this bug. I'd prefer the webservice respect the Authorization header, since that's the least invasive change.

          Michael Wiencek added a comment - Yeah, I wasn't proposing the user-tags thing as a hack, just mentioning it to help anyone looking into this bug. I'd prefer the webservice respect the Authorization header, since that's the least invasive change.

          Adding "user-tags" to get the completely unrelated list of private collections seems like a very dirty hack, I've entered MBS-6152 which seems like the better solution.

          Wieland Hoffmann added a comment - Adding "user-tags" to get the completely unrelated list of private collections seems like a very dirty hack, I've entered MBS-6152 which seems like the better solution.

          Did a bit more investigating:

          At first, I thought this bug was due to the fact that we're not setting require_authentication for the collections resource, therefore the requests were never returning private collections. Surprisingly, I found out that require_authentication actually has no effect, whether you force it to remain True or False. That's because when Picard first starts, it makes an authenticated request to get a list of the user's collections. QNetworkAccessManager caches the session cookie from that request, which all future requests send.

          I compared the request headers sent to the test server to those on beta, and the test server is missing an Authentication header. On beta, you can force it to return private collections by including an inc flag which requires auth, like user-tags. With "inc=collections" alone, it doesn't want to use the credentials.

          Michael Wiencek added a comment - Did a bit more investigating: At first, I thought this bug was due to the fact that we're not setting require_authentication for the collections resource, therefore the requests were never returning private collections. Surprisingly, I found out that require_authentication actually has no effect, whether you force it to remain True or False. That's because when Picard first starts, it makes an authenticated request to get a list of the user's collections. QNetworkAccessManager caches the session cookie from that request, which all future requests send. I compared the request headers sent to the test server to those on beta, and the test server is missing an Authentication header. On beta, you can force it to return private collections by including an inc flag which requires auth, like user-tags. With "inc=collections" alone, it doesn't want to use the credentials.

          Strange...this seems to be an MBS bug. It works when I use test.mb in the Picard options, but not when I use the main server. That must be why I never caught this bug. :/

          Michael Wiencek added a comment - Strange...this seems to be an MBS bug. It works when I use test.mb in the Picard options, but not when I use the main server. That must be why I never caught this bug. :/

            outsidecontext Philipp Wolfer
            mineo Wieland Hoffmann
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                Version Package
                2.1