Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

dependabot-alerts.mjs's openAlerts() has no error handling for a rate-limited or partially-failed GitHub API response

Abierto
#2,425 1 comentario 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
74/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
github, javascript
Área
api, cli, testing

Línea de trabajo

Comienza con openAlerts() en scripts/dependabot-alerts.mjs y compara su llamada a gh api con isPermissionDenied() y el manejo existente. Ejecuta scripts/dependabot-alerts.test.mjs y, después, añade cobertura para respuestas paginadas limitadas por tasa y parcialmente fallidas. La tarea está terminada cuando los fallos se gestionan deliberadamente sin una excepción no controlada y las pruebas de las rutas negativas pasan.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

bug v2
Which version line?

v2 — current (@modelcontextprotocol/inspector@latest)

Which client?

All / shared core

Inspector version

2.7.0 (git tag) — static code-review finding, not run locally

Node version

N/A — static code review, no live run performed

Operating system (and browser, for the web client)

N/A — static code review

Transport

Not applicable / never connected

MCP server under inspection

N/A — this is a static code-review finding against the 2.7.0 tag's scripts/dependabot-alerts.mjs, not a live reproduction against a running MCP server.

Steps to reproduce

Found via static review of the 2.7.0 tag source, not a live run.

  1. scripts/dependabot-alerts.mjs's isPermissionDenied() (~line 737) explicitly detects and handles rate-limiting for the "is Dependabot security-fixes enabled" check, and main() has a test covering "continues, reporting UNVERIFIED, when the token cannot read the setting."
  2. The actual alert-listing function, openAlerts() (~lines 797-805), calls gh api --paginate --slurp repos/${repo}/dependabot/alerts?state=open&per_page=100 with no try/catch or equivalent handling around that call, unlike the permission-check path.
  3. A repo-wide read of the co-located scripts/dependabot-alerts.test.mjs finds tests for the permission-check rate-limit path but no negative-path test exercising openAlerts() itself against a rate-limited (403/429) or partially-failed (paginated request cut off mid-stream) GitHub API response.
    No live run against the GitHub API was performed; this is based on reading the script and its test file against the 2.7.0 tag.
Expected behavior

openAlerts() handles a rate-limited (403/429) or partially-failed paginated response from the GitHub API the same deliberate way isPermissionDenied() already handles rate-limiting for the security-fixes-setting check — either surfacing a clear, non-crashing error/UNVERIFIED result, or retrying — rather than letting an unhandled exception propagate out of gh api.

Actual behavior

openAlerts() calls gh api --paginate --slurp repos/${repo}/dependabot/alerts?state=open&per_page=100 with no try/catch and no test covering what happens when that call is rate-limited or fails partway through a paginated response — in contrast to the permission-check path a few functions away, which explicitly detects and handles rate-limiting (isPermissionDenied(), covered by tests at lines 234-253 of the test file).

Suggested fix: wrap openAlerts()'s gh api call in the same kind of error handling as the permission-check path (detect rate-limit/partial-failure, surface a clear error or retry), and add a negative-path test for it alongside the existing rate-limit test for isPermissionDenied().

Logs, errors, or screenshots

No response

Already prototyped a fix?

No response

Before you submit
  • I searched existing issues and this is not a duplicate.
  • This is not a security vulnerability report (those go through the private advisory process).
Lenguaje dominante
TypeScript
Estrellas
10.9k
Forks
1.5k
Merge medio
5 h 41 min
PR fusionados (30 d)
145

Guía de contribución

Abrir la guía de contribución

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 modelcontextprotocol/inspector

Todos los issues de modelcontextprotocol/inspector

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.