Download statistics page shows "not available" for GitHub-hosted releases

Abierto
#1,946 2 comentarios 2 reacciones 1 asignado Ver en GitHub

Los mantenedores suelen responder en 1 día

@miaulalala ya está trabajando en esto.

Desde el 1/10/2026.

Evaluación

Este issue todavía no se ha evaluado.

Descripción

bug feature: frontend

The new download statistics page from #1796 (/apps/<id>/downloads) shows "— not available" for every release of my app, although all releases are GitHub release assets and GitHub reports counts for them.

App: extended_occweb, checked 2026-10-01

Version Download URL in the store Page shows GitHub API download_count
0.4.7 https://github.com/dillardblom/occweb/releases/download/v0.4.7/extended_occweb-0.4.7.tar.gz not available 27
0.4.6 …/releases/download/v0.4.6/extended_occweb-0.4.6.tar.gz not available 21
0.4.5 …/releases/download/v0.4.5/extended_occweb-0.4.5.tar.gz not available 7

The URLs match _GITHUB_RELEASE_URL_RE, and the asset names returned by GET /repos/dillardblom/occweb/releases are exactly the file names in the URLs, so the lookup in get_download_counts() should find them. The repository is public.

That leaves the GitHub API call itself. get_download_counts() catches every requests.RequestException and silently returns None for all releases, so any failure looks like this. A likely cause, from reading the code:

  • GITHUB_API_TOKEN defaults to None. Without a token, GitHub allows 60 requests per hour per IP, shared by everything on the app store server.
  • Each view of the page, and each call to the API endpoint, makes at least two uncached requests (get_releases() keeps paging until it gets an empty page).

So the limit would be used up quickly once a few developers open the page.

Suggestions:

  1. Configure GITHUB_API_TOKEN in production, if it isn't set yet (5,000 requests/hour).
  2. Cache the counts per repository for some minutes.
  3. Stop paging when a page has fewer than per_page items, which saves one request per view in the common case.
  4. Log the exception instead of passing silently, so this shows up in the server logs.

I can't see the server logs, so the rate limit is an educated guess; the log line from (4) would confirm or rule it out.

Lenguaje dominante
Python
Estrellas
398
Forks
180
Merge medio
2 d 15 h
PR fusionados (30 d)
15

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de nextcloud/appstore

Todos los issues de nextcloud/appstore

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.