[Bug]: capacitor/http Upload progress not supported
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 48/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- javascript, swift, typescript
- 領域
- api, mobile-dev
調査の方向性
まず、Capacitor HTTP plugin のネイティブ iOS における URLSession の使用方法と Android における RequestBody の処理を調査し、それらを Capacitor File Transfer plugin の進捗実装と比較します。両プラットフォームが利用可能な進捗データを含む uploadProgress 通知を発行し、既存のダウンロード動作が維持されれば、作業は完了です。
索引モデルが issue の本文から書いたものです。
説明
Capacitor Version
I would like to address an issue that was automatically closed. I am having the same problem.
https://github.com/ionic-team/capacitor/issues/6658
Currently, the Capacitor HTTP plugin does not emit upload progress events, so passing onUploadProgress in requests has no effect. This is not a bug in user code — it is a limitation of the plugin:
• iOS: Uses URLSession.shared without a delegate. Upload progress requires implementing urlSession(_:task:didSendBodyData:totalBytesSent:totalBytesExpectedToSend:).
• Android: Uses RequestBody directly without a wrapper. Upload progress requires a custom RequestBody that reports bytes written.
By contrast, the Capacitor File Transfer plugin handles native upload progress correctly on both platforms.
Upload progress is critical for mobile apps that handle large files. Adding native support would allow the Capacitor HTTP plugin to:
1. Support progress bars and UI feedback during uploads.
2. Reach feature parity with web APIs like XHR and Axios.
3. Make Capacitor a complete solution for file uploads without relying on additional plugins.
Request: Please add native upload progress support on iOS and Android, and expose it via notifyListeners("uploadProgress") so developers can track upload progress natively.
Platforms Affected
- iOS
- Android
- Web
Current Behavior
I hooked up the onprogress event in my code to show the progress of downloading a file to the user. But enabling the @capacitor/http plugin the progress doesn't show up anymore. I only see the popup and when the downloading is done, it will show the file. When I disable the plugin, the progress is shown again.
Expected Behavior
The user should see the progress of the download.
Project Reproduction
makeXMLRequest(method, params, headers, useDatabase=true, cancelFunc, progressFunc) {
const req = this.checkParams(params, headers, useDatabase);
if (req.error !== undefined && req.error !== null) {
return Promise.reject(req.error);
}
return new Promise((resolve, reject) => {
let fetch = new XMLHttpRequest();
if (cancelFunc !== undefined && cancelFunc !== null) {
cancelFunc.cancel = () => {
fetch.abort(null);
};
}
// open a connection
fetch.open("POST", req.host);
// set extra request headers
for (const key in req.headers) {
fetch.setRequestHeader(key, req.headers[key]);
}
fetch.onload = (oEvent) => {
if (fetch.status >= 200 && fetch.status < 300) {
// difference between @capacitor/http and the 'normal' XMLHttpRequest
// @capacitor/http returns already a JSON
const result = JSON.parse(fetch.response);
resolve(result.result);
} else {
reject(fetch.statusText);
}
};
// send progress data back
fetch.onprogress = (oEvent) => {
if (progressFunc !== undefined && progressFunc !== null) {
progressFunc(oEvent.loaded, oEvent.total);
}
};
fetch.onerror = (oEvent) => {
reject(fetch.statusText);
};
// abort the connection
fetch.onabort = (oEvent) => {
reject(false);
};
// send the data
fetch.send(JSON.stringify(
{method: method, params: req.params, id: req.uid}
));
});
}
- 主要言語
- TypeScript
- スター
- 17.1k
- フォーク
- 1.3k
- 平均マージ
- 1日 22時間
- マージ済み PR(30日)
- 26
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
ionic-team/capacitor のほかの issue
-
triage
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
ionic-team/capacitor#8759 ·
メンテナーはふだん 1 日以内に返信
-
[Bug]: Plugin call after navigation can be answered before reply proxy is updated対応中かも @MateStrysewske が 71 日前に担当しました。 オープンtriage
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
ionic-team/capacitor#8616 ·
メンテナーはふだん 1 日以内に返信
-
help wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
ionic-team/capacitor#8574 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
SystemBars: safe area CSS injection throws "Cannot read properties of null" on startup (Android 16)対応中かも @kttalley が 62 日前に担当しました。 オープンtriage
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
ionic-team/capacitor#8530 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
fix(android): remove unchecked Java compilation warnings対応中かも @Ajamuar が 15 日前に担当しました。 オープンtriage
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
ionic-team/capacitor#8529 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
ionic-team/capacitor の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
prio:low scope:world
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
OliverRomhagen/vrigstad-joyride#849 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
genfeedai/genfeed.ai#11916 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
erkamyaman/rust-anything#1153 ·
メンテナーはふだん 1 日以内に返信
-
The Phase 5 report says 0.3.0 waits for the live check対応中かも @fzn0x が今日担当しました。 オープンdocumentation
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信