Skip to content

Project version reports no primary file, yet UI designates one as primary #2656

@itzg

Description

@itzg

Describe the bug

When retrieving a version of a project with https://api.modrinth.com/v2/project/698NGGtb/version?loaders=%5B%22paper%22%5D&game_versions=%5B%221.19.3%22%5D

Then no files are designated as primary in the response:

    "files": [
      {
        "hashes": {
          "sha512": "8040d1bdb4cd9c5a0976ab2b41005b8405ad0e56894e84b5192541c6338c4bce404008808f78085e5020081c7f04876275a6014534dbd5835d63c7851195bac5",
          "sha1": "80e080ca558ab366da36ea87b9baa97a7edb08a7"
        },
        "url": "https://cdn.modrinth.com/data/698NGGtb/versions/AlzUrzCs/all-plugins.zip",
        "filename": "all-plugins.zip",
        "primary": false,
        "size": 3843079,
        "file_type": null
      },
      {
        "hashes": {
          "sha512": "a83a63e83dfc375d23e7ba57e77fdc4a91a9de5d46b545b3b79f708c4107fbdade5291eabb31acd80a4f0716589693320f2f714a446e62273c0dd2929fdc0797",
          "sha1": "76524335d6fa0f911fcd801cc12c9506e58a14a7"
        },
        "url": "https://cdn.modrinth.com/data/698NGGtb/versions/AlzUrzCs/vane-plexmap-1.10.3.jar",
        "filename": "vane-plexmap-1.10.3.jar",
        "primary": false,
        "size": 13395,
        "file_type": null
      },
      {
        "hashes": {
          "sha1": "23b68b8d2984eac046966c138e5393df8bcbf013",
          "sha512": "1336036172d4f4a4d10bc09cfca2bb4bc58922bf86ad03931ac8bc212deee1bd23ec69b2116d71c1c2c2da0b4d2d857696a6e379436b9b1ff3f7337a69940846"
        },
        "url": "https://cdn.modrinth.com/data/698NGGtb/versions/AlzUrzCs/vane-velocity-1.10.3.jar",
        "filename": "vane-velocity-1.10.3.jar",
        "primary": false,
        "size": 171997,
        "file_type": null
      },
      {
        "hashes": {
          "sha1": "bc83207bc87c541b03d45310cc0fb747d0d06b82",
          "sha512": "f91187ae8406a3c1ad41cc21d585c8bb9185942e3d946e4797ebbe0321f3d75d3d113f775827a7080203811c090641a6bd3c1af5db9fee18dc955731c73ea203"
        },
        "url": "https://cdn.modrinth.com/data/698NGGtb/versions/AlzUrzCs/vane-waterfall-1.10.3.jar",
        "filename": "vane-waterfall-1.10.3.jar",
        "primary": false,
        "size": 406122,
        "file_type": null
      }
    ],

however, the UI at https://modrinth.com/plugin/vane/version/v1.10.3 marks the first one primary

image

Is there an implied behavior that the first file is primary when none are declared primary?

Steps to reproduce

See description

Expected behavior

At least one item in files to have primary as true.

Additional context

Originally reported here itzg/docker-minecraft-server#1973 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    backendInvolves work from the backend team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions