Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

bug: [Web] CapacitorSQLite.getFromHTTPRequest resolves on 200 with empty body and “hangs” on 404

オープン
#656 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
45/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
sqlite, typescript
領域
databases, web-dev

調査の方向性

CapacitorSQLite.getFromHTTPRequest の Web 実装から始め、issue に記載された 2 つの URL を再現します。空の body を含む 200 応答と、404 応答です。既存の Web の動作と、関連するテストまたはエントリーポイントを確認します。到達可能な non-OK 応答と空の body が、成功として解決されたり無期限に待機したりしなくなれば完了です。

索引モデルが issue の本文から書いたものです。

説明

bug/fix needs: triage

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: 0 or blob.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:

  1. Run the app on Web (not installed PWA).
  2. Call getFromHTTPRequest with a URL that returns 200 but empty body, e.g. https://httpbin.org/bytes/0.
  3. Call it again with a URL that returns 404, e.g. https://httpbin.org/status/404.
  4. 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: fetch doesn’t throw on 404 (ok === false), so explicit handling and/or a timeout/AbortController might be missing in the Web implementation.
主要言語
Swift
スター
661
フォーク
158
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

capacitor-community/sqlite のほかの issue

capacitor-community/sqlite の issue をすべて見る

似ている issue

Swift の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。