bug: [Web] CapacitorSQLite.getFromHTTPRequest resolves on 200 with empty body and “hangs” on 404
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 45/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- sqlite, typescript
調査の方向性
CapacitorSQLite.getFromHTTPRequest の Web 実装から始め、issue に記載された 2 つの URL を再現します。空の body を含む 200 応答と、404 応答です。既存の Web の動作と、関連するテストまたはエントリーポイントを確認します。到達可能な non-OK 応答と空の body が、成功として解決されたり無期限に待機したりしなくなれば完了です。
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- Swift
- スター
- 661
- フォーク
- 158
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
capacitor-community/sqlite のほかの issue
-
難易度 3/5 1〜2日 初心者へのやさしさ 72/100
capacitor-community/sqlite#700 · コメント 1 件 · リアクション 1 件 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
capacitor-community/sqlite#693 · リアクション 7 件 ·
-
bug/fix needs: triage
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
capacitor-community/sqlite#690 ·
-
feature needs: triage
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
capacitor-community/sqlite#689 ·
-
bug/fix needs: triage
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
capacitor-community/sqlite#685 ·
capacitor-community/sqlite の issue をすべて見る
似ている issue
-
auth type: bug
難易度 2/5 1〜3時間 初心者へのやさしさ 90/100
googleapis/google-cloud-swift#1260 ·
メンテナーはふだん 1 日以内に返信
-
catalog-audit
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
0. Needs triage bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
clawsweeper:linked-pr-open clawsweeper:no-new-fix-pr clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster P2
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
steipete/RepoBar#140 · コメント 1 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
area:dictation bug P2
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
uttrflow/uttrflow-swift#2551 ·
メンテナーはふだん 1 日以内に返信