NativeScript / NativeScript/plugins

[@nativescript/imagepicker] - app crashes on video selection that is unloaded to iCloud

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

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

主要言語
TypeScript
スター
206
フォーク
123
平均マージ
2日 1時間
マージ済み PR(30日)
1

説明

Using @nativescript/imagepicker
When I pick a video that's stored locally it works as expected but if the video is old and is unloaded to iCloud to save device's storage it crashes the app immediately with the following error:

authorizing...
  ***** Fatal JavaScript exception - application has been terminated. *****
  NativeScript encountered a fatal error: Uncaught Error: The file couldn\M-b\M^@\M^Z\M-C\M^D\M-C\M-4t be opened.
  at
  _loop_2(file: src/webpack:/mitch/node_modules/@nativescript/imagepicker/index.ios.js:148:0)
  at (file: src/webpack:/mitch/node_modules/@nativescript/imagepicker/index.ios.js:158:0)
  at timer(file: src/webpack:/mitch/node_modules/zone.js/fesm2015/zone.js:2405:0)
  at invokeTask(file: src/webpack:/mitch/node_modules/zone.js/fesm2015/zone.js:406:0)
  at runTask(file: src/webpack:/mitch/node_modules/zone.js/fesm2015/zone.js:178:0)
  at invokeTask(file: src/webpack:/mitch/node_modules/zone.js/fesm2015/zone.js:487:0)
  at ZoneTask.invoke(file: src/webpack:/mitch/node_modules/zone.js/fesm2015/zone.js:476:0)
  at data.args.<computed>(file: src/webpack:/mitch/node_modules/zone.js/fesm2015/zone.js:2385:0)
  at invoke(file: src/webpack:/mitch/node_modules/@nativescript/core/timer/index.ios.js:54:0)
  at invoke(file: src/webpack:/mitch/node_modules/zone.js/fesm2015/zone.js:372:0)
  at runGuarded(file: src/webpack:/mitch/node_modules/zone.js/fesm2015/zone.js:144:0)
  at (file: src/webpack:/mitch/node_modules/zone.js/fesm2015/zone.js:128:0)
  at TimerTargetImpl.tick(file: src/webpack:/mitch/node_modules/@nativescript/core/timer/index.ios.js:18:0)

and this is how I'm handling video selection:

if (result === "Add video") {
        this.mediaType = "video";
        let videoPicker = imagePickerPlugin.create({
          mode: 'single',
          mediaType: ImagePickerMediaType.Video
        });

        this.startVideoSelection(videoPicker);
      }


---

startVideoSelection(videoPicker) {
    videoPicker
      .authorize()
      .then(() => videoPicker.present())
      .then((selection) => {
        console.log('Selection done: ' + JSON.stringify(selection));

        this.processVideo(selection);
      })
      .catch((err) => {
        console.log(err);
        // this.errorMessage = err;
      });
  }

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

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

はじめの一歩

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

調査の方向性

stack trace で特定されている @nativescript/imagepicker/index.ios.js の148〜158行目付近から始め、iCloud にオフロードされた動画の選択を再現します。この選択によってアプリがクラッシュせず、失敗が picker フローを通じて処理されれば完了です。

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

評価

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

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

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