NativeScript / NativeScript/nativescript-cli

NS 7 thread worker native object reference null

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

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

主要言語
JavaScript
スター
1.1k
フォーク
204
平均マージ
1日 9時間
マージ済み PR(30日)
8

説明

Environment

  • CLI: 7.0.8
  • Android Runtime: 7.0.0

Describe the bug

I'm using a custom Java class to hold native objects references to share between UI thread and an worker thread, that
Worker thread with globals module imported can find and execute native code like java.lang.Thread.currentThread().getName() or my Java Class, as expected, but when its terminated and re-created throw an error and the app stops because cannot find the native objects instances to work with.

-- First time exec

JS: =================== W0: ./aeb532eaa4f320c850fc.worker.js ===================
JS: pkg: com.jnovas {
JS:   "objectpool": {}
JS: }
JS: pkg: java.lang.Thread function () { [native code] }

-- Second time exec

JS: =================== worker ===================
JS: pkg: com.jnovas {"ObjectPool":0,"objectpool":{"BuildConfig":0}}
JS: pkg: java.lang.Thread 0
JS: Uncaught TypeError: com.jnovas.ObjectPool.getInstance is not a function

Additional context
works just fine on NS 6

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

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

調査の方向性

ソースファイルもテストも指定されていません。まず、NativeScript 7 でカスタム Java ObjectPool を使用した worker の終了と再作成のシーケンスを再現し、その後 NativeScript 6 と比較してください。再作成された worker がネイティブオブジェクトの参照を解決し、報告された TypeError なしで ObjectPool.getInstance を呼び出せれば完了です。

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

評価

技術スタック
android, javascript
領域
mobile-dev
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
25/100

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

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