bug: [Web] CapacitorSQLite.getFromHTTPRequest resolves on 200 with empty body and “hangs” on 404
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 45/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Estancado
- Stack tecnológico
- sqlite, typescript
Línea de trabajo
Comienza por la implementación Web de CapacitorSQLite.getFromHTTPRequest y reproduce las dos URLs indicadas en el issue: la respuesta 200 con un body vacío y la respuesta 404. Comprueba el comportamiento Web existente y cualquier prueba o punto de entrada relacionado. La tarea estará terminada cuando las respuestas no-OK alcanzables y los bodies vacíos ya no se resuelvan correctamente ni esperen indefinidamente.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Plugin version:
@capacitor-community/sqlite 7.0.0
Platform(s):
Web (tested on Chrome 139, Windows 10).
(App works differently on native; issue appears specific to Web.)
Current behavior:
- When the URL returns HTTP 200 with an empty body (e.g.,
Content-Length: 0),CapacitorSQLite.getFromHTTPRequest(options)resolves without error even though nothing is downloaded/imported. - When the URL returns HTTP 404, the Promise neither resolves nor rejects (appears to hang/freezes), leaving the caller waiting indefinitely.
Expected behavior:
- On non-OK responses (e.g., 404), the Promise should reject with a meaningful error (e.g.,
HTTP 404). - On 200 with empty body (
Content-Length: 0orblob.size === 0), the Promise should reject (e.g.,Empty response body) because there is nothing to import. - Ideally, minimal content validation (when expecting a DB/ZIP) should prevent a false positive “success.”
Steps to reproduce:
- Run the app on Web (not installed PWA).
- Call
getFromHTTPRequestwith a URL that returns 200 but empty body, e.g.https://httpbin.org/bytes/0. - Call it again with a URL that returns 404, e.g.
https://httpbin.org/status/404. - Observe that the first call resolves “success” despite no data; the second call never resolves or rejects.
Related code:
import { CapacitorSQLite, capSQLiteHTTPOptions } from '@capacitor-community/sqlite';
async function test(url: string) {
const options: capSQLiteHTTPOptions = {
url,
overwrite: true,
};
console.time(url);
try {
await CapacitorSQLite.getFromHTTPRequest(options);
console.log('RESOLVED (unexpected if empty body or 404):', url);
} catch (err) {
console.error('REJECTED (expected on HTTP errors or empty body):', url, err);
} finally {
console.timeEnd(url);
}
}
// A) 200 with empty body
test('https://httpbin.org/bytes/0'); // 200 OK, Content-Length: 0
// B) 404
test('https://httpbin.org/status/404'); // 404 Not Found
Other information:
- Browser: Chrome 139 on Windows 10.
- Framework: Ionic/Angular [please fill].
- Repro was done “from web”; not an installed PWA.
- With generic pages that return 200 but not a valid DB/ZIP (e.g.,
https://www.google.com), the call can also resolve, suggesting missing content validation on Web. - CORS: endpoints with CORS disabled correctly throw CORS errors (unrelated); the bug here is about reachable URLs returning 200/404.
- Likely Web-only:
fetchdoesn’t throw on 404 (ok === false), so explicit handling and/or a timeout/AbortControllermight be missing in the Web implementation.
- Lenguaje dominante
- Swift
- Estrellas
- 661
- Forks
- 158
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de capacitor-community/sqlite
-
Dificultad 3/5 1-2 días Aptitud para principiantes 72/100
capacitor-community/sqlite#700 · 1 comentario · 1 reacción ·
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
capacitor-community/sqlite#693 · 7 reacciones ·
-
bug/fix needs: triage
Dificultad 3/5 1-2 días Aptitud para principiantes 68/100
capacitor-community/sqlite#690 ·
-
feature needs: triage
Dificultad 3/5 1-2 días Aptitud para principiantes 55/100
capacitor-community/sqlite#689 ·
-
bug/fix needs: triage
Dificultad 3/5 1-2 días Aptitud para principiantes 45/100
capacitor-community/sqlite#685 ·
Todos los issues de capacitor-community/sqlite
Issues similares
-
auth type: bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 90/100
googleapis/google-cloud-swift#1260 ·
Los mantenedores suelen responder en 1 día
-
Catalog audit: broken entriesAbiertocatalog-audit
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
0. Needs triage bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
clawsweeper:linked-pr-open clawsweeper:no-new-fix-pr clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster P2
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
steipete/RepoBar#140 · 1 comentario · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
area:dictation bug P2
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
uttrflow/uttrflow-swift#2551 ·
Los mantenedores suelen responder en 1 día