From issues-return-96339-archive-asf-public=cust-asf.ponee.io@cordova.apache.org Fri Jul 20 22:19:04 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 9B5B2180663 for ; Fri, 20 Jul 2018 22:19:03 +0200 (CEST) Received: (qmail 3223 invoked by uid 500); 20 Jul 2018 20:19:02 -0000 Mailing-List: contact issues-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list issues@cordova.apache.org Received: (qmail 3212 invoked by uid 99); 20 Jul 2018 20:19:02 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 20 Jul 2018 20:19:02 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 0FF6F1A1647 for ; Fri, 20 Jul 2018 20:19:02 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -109.001 X-Spam-Level: X-Spam-Status: No, score=-109.001 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, KAM_ASCII_DIVIDERS=0.8, KAM_NUMSUBJECT=0.5, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, USER_IN_DEF_SPF_WL=-7.5, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id TrkQRegYOvCf for ; Fri, 20 Jul 2018 20:19:01 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id EBE245F178 for ; Fri, 20 Jul 2018 20:19:00 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 8F718E00CC for ; Fri, 20 Jul 2018 20:19:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 4DB6121EE2 for ; Fri, 20 Jul 2018 20:19:00 +0000 (UTC) Date: Fri, 20 Jul 2018 20:19:00 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: issues@cordova.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CB-14197) createFile/writeFile does not consistently execute the 'write' action resulting in files of size 0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CB-14197?page=3Dcom.atlassian.j= ira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D165512= 18#comment-16551218 ]=20 ASF GitHub Bot commented on CB-14197: ------------------------------------- macdonst commented on issue #237: CB-14197: (all) Fix for createFile/writeF= ile silently failing to send 'write' action URL: https://github.com/apache/cordova-plugin-file/pull/237#issuecomment-40= 6715606 =20 =20 Thanks for the PR @wfairclough, good catch.=20 ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. =20 For queries about this service, please contact Infrastructure at: users@infra.apache.org > createFile/writeFile does not consistently execute the 'write' action res= ulting in files of size 0 > -------------------------------------------------------------------------= ------------------------- > > Key: CB-14197 > URL: https://issues.apache.org/jira/browse/CB-14197 > Project: Apache Cordova > Issue Type: Bug > Components: cordova-plugin-file > Reporter: Will Fairclough > Priority: Major > > Occasionally=C2=A0when calling the *createFile* API the *write* action do= es not get called.=C2=A0It was not very consistent though and it is very ha= rd to reproduce. It seems as though the *onload* event was not firing on th= e fileReader in the write method resulting in the file never getting writte= n and no callbacks being fired. > {code:java} > if (data instanceof File || (!isProxySupportBlobNatively && supportsBinar= y && data instanceof Blob)) { > =C2=A0 =C2=A0var fileReader=3Dnew FileReader(); > =C2=A0 =C2=A0/* eslint-enable no-undef */ > =C2=A0 =C2=A0fileReader.onload=3Dfunction () { > =C2=A0 =C2=A0// Call this method again, with the arraybuffer as argument > =C2=A0 =C2=A0 =C2=A0 FileWriter.prototype.write.call(that, this.result, t= rue/* isPendingBlobReadResult */); > =C2=A0 =C2=A0}; > =C2=A0 =C2=A0... > } > {code} > We found we would notice the issue more consistently when running the app= in the Android emulator subsequent times in a row with the command: > {code:java} > $ cordova run android{code} > We fixed this by requiring the FileReader module: > [https://github.com/suitespot/cordova-plugin-file/commit/2a0da7f1a43e88b8= 01ee70a3462c3df829f4c927] > With this change we have not noticed the issue anymore. > I also believe this *ionic-native*=C2=A0issue is related to this: > [https://github.com/ionic-team/ionic-native/issues/2067#issuecomment-4036= 00570] > =C2=A0 > =C2=A0 -- This message was sent by Atlassian JIRA (v7.6.3#76005) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org For additional commands, e-mail: issues-help@cordova.apache.org