NativeScript / NativeScript/plugins

composing email with attachments fails on Android (fix provided)

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

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

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

説明

@nativescript/Email v2.0.5

Error
Calling email.compose with array 'attachments' fails with this error:
JS: 'Error in email.compose: TypeError: Cannot read property 'indexOf' of undefined'

Problem
The problem is that 'compose' in "index.android.js" parses attachments using a "for-in" loop. My array created via brackets in JS has a 'move' method by default, and so this for-in loop parses 'attachments[move]' which fails.

Fix
The fix is simply to change it to a "for-of" loop, as is the case in "index.ios.js".
Replace this...
for (const a in arg.attachments) {
const attachment = arg.attachments[a];
with this...
for (const attachment of arg.attachments) {

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

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

はじめの一歩

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

調査の方向性

index.android.js を開き、index.ios.js の for-of ループと添付ファイルの処理を比較します。要求された反復処理の変更を確認し、Android で添付ファイルの配列を使用してメールを作成するテストを行います。添付ファイルによって報告された indexOf エラーが発生しなくなれば完了です。

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

評価

技術スタック
android, javascript
領域
mobile
issue の種類
バグ
難易度
1/5
見積もり時間
1時間未満
活発さ
停滞
明瞭さ
明確に書かれている
初心者へのやさしさ
50/100

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

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