IQSS / IQSS/dataverse

Download Dataset with POST Access and signedUrl not incrementing download count

Open
#12,572 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

GREI Re-arch SPA Type: Bug
Dominant language
Java
Stars
1.1k
Forks
564
Avg merge
2d 2h
Merged PRs (30d)
29

Description

Downloading a zip of a dataset from the Modern UI isn't triggering an increment of the download count.
It can be reproduced by making the same API calls as the UI, below.

What steps does it take to reproduce the issue?

  1. create a dataset with a file and publish it

  2. Check that the download count:
    curl -sS
    -H "X-Dataverse-key: $API_TOKEN"
    "$SERVER/api/v1/datasets/$DATASET_ID/download/count" | jq .

  3. Do a post to get the signed URL
    SIGNED_URL="$(
    curl -sS -X POST
    -H "X-Dataverse-key: $API_TOKEN"
    "$SERVER/api/v1/access/dataset/$DATASET_ID?format=original"
    | tee /tmp/dataverse-signed-url.json
    | jq -r '.data.signedUrl'
    )"

echo "$SIGNED_URL"

  1. Use the signed url to download the file:
    curl -fL
    -o /tmp/dataset.zip
    "$SIGNED_URL"

  2. Check the download count again, it isn't incremented:
    curl -sS
    -H "X-Dataverse-key: $API_TOKEN"
    "$SERVER/api/v1/datasets/$DATASET_ID/download/count" | jq .

  • When does this issue occur?
    From the Modern UI, downloading zip file from a dataset

  • Which page(s) does it occurs on?
    Dataset page

  • What happens?
    download count is not incremented

  • To whom does it occur (all users, curators, superusers)?
    all

  • What did you expect to happen?
    should increment count

Which version of Dataverse are you using?

Image

Any related open or closed issues to this bug report?

Screenshots:

No matter the issue, screenshots are always welcome.

To add a screenshot, please use one of the following formats and/or methods described here:

Are you thinking about creating a pull request for this issue?
Help is always welcome, is this bug something you or your organization plan to fix?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the POST /api/v1/access/dataset/$DATASET_ID?format=original request and then downloading its signedUrl, comparing the download count before and after. Trace the access and download-count entry points used by the Modern UI; done means the count increments for this dataset ZIP download.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.