nativescript-community / nativescript-community/https
GET fails with 'android.os.NetworkOnMainThreadException'
オープン
まだ誰も着手していません。
- 主要言語
- Vue
- スター
- 52
- フォーク
- 40
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
I'm testing on Android so I don't know about iOS.
Test code:
import * as HTTP from '@nativescript-community/https';
...
let url = "https://historylines.com/nexus/ttw.jsp?a=add&app=LA&uid=test_fde9f33899e13fcc&drill=Open%20Shooting%20-%20Single%20Target&shots=7";
console.log("logSession: "+url);
HTTP.request({
url: url,
method: "GET",
timeout: 30000
})
.then((response) => {
let content = response.content.toJSON();
console.log("logSession response: "+JSON.stringify(content, null, 4));
if(!content){
console.error("logSession response is missing content");
reject("logSession response is missing content");
}else{
resolve(content);
}
})
.catch((err) => {
console.error("logSession failed, "+err);
reject(err);
});
When I run this code or similar with core/http, it succeeds. When I put the URL in a web browser, it succeeds. When I run with https, it fails with:
logSession failed, Error: android.os.NetworkOnMainThreadException
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず、issue に記載された GET リクエストを Android 上で再現し、@nativescript-community/https のパスと core/http を比較します。リクエストがどこでディスパッチされるかを追跡し、なぜ main thread に到達するのかを特定します。その後、同じリクエストが NetworkOnMainThreadException なしで完了すること、および既存の Android の動作が維持されることを確認します。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- android, javascript
- 領域
- mobile, networking
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 静か
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 48/100