[GitHub] cordova-plugin-network-information pull request: fix NullPointerEx...

2014-06-17 Thread dozer47528
Github user dozer47528 commented on the pull request:


https://github.com/apache/cordova-plugin-network-information/pull/10#issuecomment-46393109
  
@ceetah  ,@clelland has commited it 8 days ago. You can pull the the new 
code from `master`.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


Re: Early Gradle successes

2014-06-17 Thread Ian Clelland
I'm looking into this now; as far as I understood the wrapping process, the
files that were checked into git should have been sufficient to download
gradle and all of its dependencies. Obviously something is missing, though.
I'll let you know as soon as I figure out which piece it is.

Ian


On Tue, Jun 17, 2014 at 7:19 PM, Joe Bowser  wrote:

> I'm getting the following error:
> Error: Could not find or load main class
> org.gradle.wrapper.GradleWrapperMain
>
> Searching for this error tells me that I need the GradleWrapper JAR
> file.  I'm not sure where we'd get this file from, but it seems
> required for this to work.
>
> On Tue, Jun 17, 2014 at 2:39 PM, Ian Clelland 
> wrote:
> > ... and as Joe noticed, I managed to commit all of this locally, and push
> > none of it.
> >
> > That's fixed; things should work better now.
> >
> > Ian
> >
> >
> > On Tue, Jun 17, 2014 at 9:29 AM, Ian Clelland 
> > wrote:
> >
> >> I've been playing with Gradle builds for Cordova Android, and have
> managed
> >> to put together an initial working build system, which I've committted
> in
> >> the 4.0.x branch.
> >>
> >> If anyone wants to test it out, check out and build a project with that
> >> branch. Then, from the platforms/android dir, just run
> >>
> >> ./gradlew build
> >>
> >> (You may have to set your JAVA_HOME directory; I usually just prefix the
> >> command, and run it like
> >>
> >> JAVA_HOME=`/usr/libexec/java_home` ./gradlew build
> >> )
> >>
> >> gradlew is a wrapper script, which on first run will download all of the
> >> bits that are needed. Subsequent runs will be faster and not require
> >> network access. Eventually this command would be the one run by the
> build
> >> scripts.
> >>
> >> My next step is to get is to get it working with Crosswalk as well -- I
> >> have it working locally (and assembling architecture-specific APKs!),
> but
> >> it required some changes to the Crosswalk engine plugin before it would
> >> build.
> >>
> >> If anyone wants to try it out, feedback is welcomed.
> >>
> >> Thanks,
> >> Ian
> >>
>


Re: File-transfer: delete target file on process error

2014-06-17 Thread Ian Clelland
On Tue, Jun 17, 2014 at 9:34 PM, Andrew Grieve  wrote:

> If it's cached... won't it exist?
>

Exactly this. A 304 request should only be received in response to a
conditional GET request. There's generally no reason to send a conditional
GET unless you already have a cached copy of the file -- that is, unless
you really don't care about its contents; only whether it's changed. But if
that's the case, then why are you using the file-transfer plugin?

File-transfer is designed to be really simple. I think that we should allow
the developer to set If-Modified-Since headers any way that they like -- or
even If-None-Match, or crazier headers like If-Range, but we shouldn't set
those headers by default. Then, if a 304 is returned, then the right thing
to do is return *success* and not touch the file on disk at all.
File-transfer has fulfilled its API: the file exists where it should.

I don't think that we should automatically set the If-Modified-Since
header. My concern is that lots of other file operations could change that
date -- usually by modifying the file and setting it to *now* -- and in
that case, you might never get a newer copy of the resource you've
requested.

We could certainly add a flag to insert the header, based on the file's
timestamp. Then a dev who knows the file hasn't been touched can set it.

I think that anyone looking for something more complicated than this should
just use XHR and File, and manage the request and response headers
themselves.

Ian


>
> On Tue, Jun 17, 2014 at 11:56 AM, Javier Puerto  wrote:
>
> > I think it's better to use the error callback because for cached
> resources
> > doesn't makes sense to use the "Entry" as parameter as the target will
> not
> > exists..There's no error but the file transfer was unable to download
> > anything due to the 304 response so IMO the error callback could do the
> > job.
> >
> >
> > 2014-06-17 16:27 GMT+02:00 Andrew Grieve :
> >
> > > How about adding a second parameter to the callback? Android and iOS
> > > bridges both support this natively, and you can simulate it on other
> > > platforms by manually unpacking the parameters in your own callback.
> > >
> > >
> > > On Tue, Jun 17, 2014 at 4:18 AM, Javier Puerto 
> > wrote:
> > >
> > > > 2014-06-16 17:01 GMT+02:00 Andrew Grieve :
> > > >
> > > > > I think this behaviour has been around for a while, and makes sense
> > in
> > > > the
> > > > > majority of cases.
> > > >
> > > >
> > > > Yep, I did a "git blame" and this fragment of code was there from the
> > > > beginning.
> > > >
> > > >
> > > > > Best practice is to download to a temporary location,
> > > > > and then upon success move the file to its final spot.
> > > > >
> > > >
> > > > Yes, this is what I will have to do at the end. The thing is that I
> > want
> > > to
> > > > avoid a double step process. Anyway I'm still thinking that a hard
> > coded
> > > > and undocumented behaviour is not a good practice neither, mostly
> > because
> > > > there's the tools for the developer to act as he needs with the
> success
> > > or
> > > > error callback. It's about flexibility.
> > > >
> > > >
> > > > >
> > > > > That said, I think it'd be fine to add an option for not delete on
> > > error.
> > > > >
> > > >
> > > > It seems like the file transfer download is oriented to use a
> temporary
> > > > directory so it's fine for me as is (keep it simple). I think that an
> > > > explanation in the plugin documentation should be great so everyone
> can
> > > > figure how to use the download.
> > > >
> > > > About the issue CB-6928, my patch it's not valid for me as I will use
> > the
> > > > temporary directory now and probably for everyone so I will have to
> > > cancel
> > > > the pull request. The problem is still there but I wonder how can we
> > fix
> > > it
> > > > if the success callback argument is an "Entry" object, the ideal
> should
> > > be
> > > > to be able to communicate the caching status. I will change the patch
> > to
> > > > use the error callback to communicate the caching status, it's not an
> > > error
> > > > but I don't see other way. I will add also the documentation for the
> > new
> > > > caching status code and open a new pull request.
> > > >
> > > >
> > > > >
> > > > >
> > > > > On Mon, Jun 16, 2014 at 5:39 AM, Javier Puerto 
> > > > wrote:
> > > > >
> > > > > > Hi Cordova developers,
> > > > > >
> > > > > > I'm creating a system to download/update several resources from a
> > > > server
> > > > > to
> > > > > > the device and I've observe a behaviour that breaks my use case.
> > > > > >
> > > > > > After fix the issue CB-6928, I'm able to download/update all the
> > > > > resources
> > > > > > without problems. My next test was to try to download the
> resources
> > > but
> > > > > > with no server response (stopped). I've found that the plugin is
> > > > deleting
> > > > > > my target file silently because there's was an error.
> > > > > >
> > > > > > I think that the developer should be the responsible 

Re: File-transfer: delete target file on process error

2014-06-17 Thread Andrew Grieve
If it's cached... won't it exist?


On Tue, Jun 17, 2014 at 11:56 AM, Javier Puerto  wrote:

> I think it's better to use the error callback because for cached resources
> doesn't makes sense to use the "Entry" as parameter as the target will not
> exists..There's no error but the file transfer was unable to download
> anything due to the 304 response so IMO the error callback could do the
> job.
>
>
> 2014-06-17 16:27 GMT+02:00 Andrew Grieve :
>
> > How about adding a second parameter to the callback? Android and iOS
> > bridges both support this natively, and you can simulate it on other
> > platforms by manually unpacking the parameters in your own callback.
> >
> >
> > On Tue, Jun 17, 2014 at 4:18 AM, Javier Puerto 
> wrote:
> >
> > > 2014-06-16 17:01 GMT+02:00 Andrew Grieve :
> > >
> > > > I think this behaviour has been around for a while, and makes sense
> in
> > > the
> > > > majority of cases.
> > >
> > >
> > > Yep, I did a "git blame" and this fragment of code was there from the
> > > beginning.
> > >
> > >
> > > > Best practice is to download to a temporary location,
> > > > and then upon success move the file to its final spot.
> > > >
> > >
> > > Yes, this is what I will have to do at the end. The thing is that I
> want
> > to
> > > avoid a double step process. Anyway I'm still thinking that a hard
> coded
> > > and undocumented behaviour is not a good practice neither, mostly
> because
> > > there's the tools for the developer to act as he needs with the success
> > or
> > > error callback. It's about flexibility.
> > >
> > >
> > > >
> > > > That said, I think it'd be fine to add an option for not delete on
> > error.
> > > >
> > >
> > > It seems like the file transfer download is oriented to use a temporary
> > > directory so it's fine for me as is (keep it simple). I think that an
> > > explanation in the plugin documentation should be great so everyone can
> > > figure how to use the download.
> > >
> > > About the issue CB-6928, my patch it's not valid for me as I will use
> the
> > > temporary directory now and probably for everyone so I will have to
> > cancel
> > > the pull request. The problem is still there but I wonder how can we
> fix
> > it
> > > if the success callback argument is an "Entry" object, the ideal should
> > be
> > > to be able to communicate the caching status. I will change the patch
> to
> > > use the error callback to communicate the caching status, it's not an
> > error
> > > but I don't see other way. I will add also the documentation for the
> new
> > > caching status code and open a new pull request.
> > >
> > >
> > > >
> > > >
> > > > On Mon, Jun 16, 2014 at 5:39 AM, Javier Puerto 
> > > wrote:
> > > >
> > > > > Hi Cordova developers,
> > > > >
> > > > > I'm creating a system to download/update several resources from a
> > > server
> > > > to
> > > > > the device and I've observe a behaviour that breaks my use case.
> > > > >
> > > > > After fix the issue CB-6928, I'm able to download/update all the
> > > > resources
> > > > > without problems. My next test was to try to download the resources
> > but
> > > > > with no server response (stopped). I've found that the plugin is
> > > deleting
> > > > > my target file silently because there's was an error.
> > > > >
> > > > > I think that the developer should be the responsible to delete or
> > leave
> > > > the
> > > > > "corrupted" file because the file-transfer plugin already
> > communicates
> > > > the
> > > > > error, I don't think that the hardcoded behaviour is a good
> solution.
> > > >  What
> > > > > do you think?
> > > > > I can open a new issue and provide the patch and test case (Android
> > > only)
> > > > >
> > > > > Best regards.
> > > > >
> > > >
> > >
> >
>


[GitHub] cordova-plugin-camera pull request: CB-6945 Make Camera plugin ind...

2014-06-17 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/cordova-plugin-camera/pull/33


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


Re: Early Gradle successes

2014-06-17 Thread Joe Bowser
I'm getting the following error:
Error: Could not find or load main class org.gradle.wrapper.GradleWrapperMain

Searching for this error tells me that I need the GradleWrapper JAR
file.  I'm not sure where we'd get this file from, but it seems
required for this to work.

On Tue, Jun 17, 2014 at 2:39 PM, Ian Clelland  wrote:
> ... and as Joe noticed, I managed to commit all of this locally, and push
> none of it.
>
> That's fixed; things should work better now.
>
> Ian
>
>
> On Tue, Jun 17, 2014 at 9:29 AM, Ian Clelland 
> wrote:
>
>> I've been playing with Gradle builds for Cordova Android, and have managed
>> to put together an initial working build system, which I've committted in
>> the 4.0.x branch.
>>
>> If anyone wants to test it out, check out and build a project with that
>> branch. Then, from the platforms/android dir, just run
>>
>> ./gradlew build
>>
>> (You may have to set your JAVA_HOME directory; I usually just prefix the
>> command, and run it like
>>
>> JAVA_HOME=`/usr/libexec/java_home` ./gradlew build
>> )
>>
>> gradlew is a wrapper script, which on first run will download all of the
>> bits that are needed. Subsequent runs will be faster and not require
>> network access. Eventually this command would be the one run by the build
>> scripts.
>>
>> My next step is to get is to get it working with Crosswalk as well -- I
>> have it working locally (and assembling architecture-specific APKs!), but
>> it required some changes to the Crosswalk engine plugin before it would
>> build.
>>
>> If anyone wants to try it out, feedback is welcomed.
>>
>> Thanks,
>> Ian
>>


Re: Early Gradle successes

2014-06-17 Thread Ian Clelland
... and as Joe noticed, I managed to commit all of this locally, and push
none of it.

That's fixed; things should work better now.

Ian


On Tue, Jun 17, 2014 at 9:29 AM, Ian Clelland 
wrote:

> I've been playing with Gradle builds for Cordova Android, and have managed
> to put together an initial working build system, which I've committted in
> the 4.0.x branch.
>
> If anyone wants to test it out, check out and build a project with that
> branch. Then, from the platforms/android dir, just run
>
> ./gradlew build
>
> (You may have to set your JAVA_HOME directory; I usually just prefix the
> command, and run it like
>
> JAVA_HOME=`/usr/libexec/java_home` ./gradlew build
> )
>
> gradlew is a wrapper script, which on first run will download all of the
> bits that are needed. Subsequent runs will be faster and not require
> network access. Eventually this command would be the one run by the build
> scripts.
>
> My next step is to get is to get it working with Crosswalk as well -- I
> have it working locally (and assembling architecture-specific APKs!), but
> it required some changes to the Crosswalk engine plugin before it would
> build.
>
> If anyone wants to try it out, feedback is welcomed.
>
> Thanks,
> Ian
>


[GitHub] cordova-blackberry pull request: CB-6968 fix bashism (source) in u...

2014-06-17 Thread jsoref
GitHub user jsoref opened a pull request:

https://github.com/apache/cordova-blackberry/pull/163

CB-6968 fix bashism (source) in update script and bb10-ndk-version



You can merge this pull request into a Git repository by running:

$ git pull https://github.com/blackberry/cordova-blackberry cb_6968

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/cordova-blackberry/pull/163.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #163


commit 1b80eca4cceddb58ddaa8556e2fc5449556ab5b2
Author: Josh Soref 
Date:   2014-06-17T21:19:06Z

CB-6968 fix bashism (source) in update script and bb10-ndk-version




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


Re: plugin test framework

2014-06-17 Thread Michal Mocny
Piotr: Actually I'm not sure how running tests in the harness would work,
since the path to the resource may be different.  However, in general, with
development using the harness you aren't making any changes to plugins.
 The whole point is for app developers who want to modify only web
application bits and not deal with native compiles.

In theory the app harness could support working on the js-modules of
plugins, but that sounds like a really niche idea.  I'd not be opposed to
someone working on it but I'm not sure you'll have luck finding volunteers.

-Michal


On Tue, Jun 17, 2014 at 5:13 PM, Michal Mocny  wrote:

> At the time I went through my design iterations I just didn't want to
> necessarily depend on cordova tooling changes / documentation.  In other
> words, someone else may have a different strategy for testing..
>
> My personal opinion would be have the test plugin ship with a plugin hook
> (those are in, right? or at least on their way), that will automatically
> update the start page if you pass a flag to run command.  Ie, in an ideal
> world:  `cordova run --tests` runs a plugin hook passing in --tests flag
> which changes the start page, in a way that isn't overwritten by the
> top-level config.xml.
>
> My 2 cents, since I don't want "our way" of testing mobile spec to be "the
> only way" to test.   Frameworks and opinions on testing change.
>
> -Michal
>
>
> On Tue, Jun 17, 2014 at 4:33 PM, Piotr Zalewa  wrote:
>
>> One thing more - it would be great if user could create a test using test
>> harness app as well. Is it also considered?
>>
>> Dnia Tue Jun 17 13:27:22 2014 Martin Gonzalez pisze:
>>
>>  It would be a nice to have in the cli, aimed to just setup the right path
>>> in the config.xml, maybe along with an another argument to build,
>>> run/emulate as well.
>>> It sounds great.
>>>
>>>
>>> 2014-06-17 15:21 GMT-05:00 Piotr Zalewa :
>>>
>>>  Thanks Martin,

 Has it been considered to create a separate command "testrun" or similar
 which would remove the need to edit the config.xml?

 Dnia Tue Jun 17 11:58:33 2014 Michal Mocny pisze:

   Martin, thanks for posting those links.

>
> And I'll look into the INFRA tickets I need to file to set up a repo
> for
> that plugin, since its ready to come out of labs.
>
>
> On Tue, Jun 17, 2014 at 2:06 PM, Martin Gonzalez <
> martin.c.glez.g...@gmail.com> wrote:
>
>   This is the Cordova Plugin Test Framework readme.md, you can catch
> up
>
>> with
>> the functionality by reading some of the content:
>>
>> Repository:
>> https://github.com/apache/cordova-labs
>>
>> Docs:
>> https://github.com/apache/cordova-labs/blob/master/README.md
>>
>> https://github.com/apache/cordova-labs/blob/cdvtest/
>> cordova-plugin-test-framework/README.md
>>
>>
>>
>> 2014-06-17 12:56 GMT-05:00 Piotr Zalewa :
>>
>>   a documentation explaining how it's gonna work
>>
>>>
>>> Dnia Tue Jun 17 10:51:58 2014 Michal Mocny pisze:
>>>
>>>What do you mean?
>>>
>>>

 On Tue, Jun 17, 2014 at 1:50 PM, Piotr Zalewa 
 wrote:

Is there any predev document?


> Dnia Mon Jun 16 18:30:46 2014 Andrew Grieve pisze:
>
> Yeah, really exciting. Thanks for taking this on.
>
>
>
>> On Mon, Jun 16, 2014 at 3:42 PM, Michal Mocny <
>> mmo...@chromium.org>
>> wrote:
>>
>> Fantastic!
>>
>>
>>  I'll try to keep an eye out on the PR's, and please ping me if
>>> you
>>> would
>>> like any help.
>>>
>>> -Michal
>>>
>>>
>>> On Mon, Jun 16, 2014 at 3:25 PM, Marcel Kinard <
>>> cmarc...@gmail.com>
>>> wrote:
>>>
>>> Hi, after some discussions here with IBM management, we’re
>>> going
>>> to
>>>
>>>   bring
>>>
 in a couple extra interns for a week to jumpstart the migration
 of

  the
>>>
>>
>>  tests out of mobile-spec into the new plugin test framework. Staci
>>>
  Cooper
 will be leading this effort, and Martin Gonzalez will be a part
 of

  it.
>>>
>>
>>
>>>  So if you see a bunch of pull requests, this is what it is for.

  We’ll
>>>
>>
>>  get
>>>
  the interns to submit an ICLA asap.




>>> --
>>>
>>
>>  Piotr Zalewa
> Mozilla
>
>
>
>--

>>> Piotr Zalewa
>>> Mozilla
>>>
>>>
>>>
>>
>> --
>> Regards,
>> Martin Gonzalez
>>
>>

Re: plugin test framework

2014-06-17 Thread Michal Mocny
At the time I went through my design iterations I just didn't want to
necessarily depend on cordova tooling changes / documentation.  In other
words, someone else may have a different strategy for testing..

My personal opinion would be have the test plugin ship with a plugin hook
(those are in, right? or at least on their way), that will automatically
update the start page if you pass a flag to run command.  Ie, in an ideal
world:  `cordova run --tests` runs a plugin hook passing in --tests flag
which changes the start page, in a way that isn't overwritten by the
top-level config.xml.

My 2 cents, since I don't want "our way" of testing mobile spec to be "the
only way" to test.   Frameworks and opinions on testing change.

-Michal


On Tue, Jun 17, 2014 at 4:33 PM, Piotr Zalewa  wrote:

> One thing more - it would be great if user could create a test using test
> harness app as well. Is it also considered?
>
> Dnia Tue Jun 17 13:27:22 2014 Martin Gonzalez pisze:
>
>  It would be a nice to have in the cli, aimed to just setup the right path
>> in the config.xml, maybe along with an another argument to build,
>> run/emulate as well.
>> It sounds great.
>>
>>
>> 2014-06-17 15:21 GMT-05:00 Piotr Zalewa :
>>
>>  Thanks Martin,
>>>
>>> Has it been considered to create a separate command "testrun" or similar
>>> which would remove the need to edit the config.xml?
>>>
>>> Dnia Tue Jun 17 11:58:33 2014 Michal Mocny pisze:
>>>
>>>   Martin, thanks for posting those links.
>>>

 And I'll look into the INFRA tickets I need to file to set up a repo for
 that plugin, since its ready to come out of labs.


 On Tue, Jun 17, 2014 at 2:06 PM, Martin Gonzalez <
 martin.c.glez.g...@gmail.com> wrote:

   This is the Cordova Plugin Test Framework readme.md, you can catch up

> with
> the functionality by reading some of the content:
>
> Repository:
> https://github.com/apache/cordova-labs
>
> Docs:
> https://github.com/apache/cordova-labs/blob/master/README.md
>
> https://github.com/apache/cordova-labs/blob/cdvtest/
> cordova-plugin-test-framework/README.md
>
>
>
> 2014-06-17 12:56 GMT-05:00 Piotr Zalewa :
>
>   a documentation explaining how it's gonna work
>
>>
>> Dnia Tue Jun 17 10:51:58 2014 Michal Mocny pisze:
>>
>>What do you mean?
>>
>>
>>>
>>> On Tue, Jun 17, 2014 at 1:50 PM, Piotr Zalewa 
>>> wrote:
>>>
>>>Is there any predev document?
>>>
>>>
 Dnia Mon Jun 16 18:30:46 2014 Andrew Grieve pisze:

 Yeah, really exciting. Thanks for taking this on.



> On Mon, Jun 16, 2014 at 3:42 PM, Michal Mocny  >
> wrote:
>
> Fantastic!
>
>
>  I'll try to keep an eye out on the PR's, and please ping me if you
>> would
>> like any help.
>>
>> -Michal
>>
>>
>> On Mon, Jun 16, 2014 at 3:25 PM, Marcel Kinard <
>> cmarc...@gmail.com>
>> wrote:
>>
>> Hi, after some discussions here with IBM management, we’re
>> going
>> to
>>
>>   bring
>>
>>> in a couple extra interns for a week to jumpstart the migration
>>> of
>>>
>>>  the
>>
>
>  tests out of mobile-spec into the new plugin test framework. Staci
>>
>>>  Cooper
>>> will be leading this effort, and Martin Gonzalez will be a part
>>> of
>>>
>>>  it.
>>
>
>
>>  So if you see a bunch of pull requests, this is what it is for.
>>>
>>>  We’ll
>>
>
>  get
>>
>>>  the interns to submit an ICLA asap.
>>>
>>>
>>>
>>>
>> --
>>
>
>  Piotr Zalewa
 Mozilla



--
>>>
>> Piotr Zalewa
>> Mozilla
>>
>>
>>
>
> --
> Regards,
> Martin Gonzalez
>
>
>
  --
>>> Piotr Zalewa
>>> Mozilla
>>>
>>>
>>
>>
>>
> --
> Piotr Zalewa
> Mozilla
>


Re: [Proposal] Cordova guidelines part of ContributorWorkflow

2014-06-17 Thread Brian LeRoux
we could do a batch reformat using:

https://github.com/rdio/jsfmt



On Tue, Jun 17, 2014 at 1:28 PM, Mark Koudritsky  wrote:

> JSHint is awesome and I'm slowly adding the JSHint config lines to almost
> every file I touch in cordova-lib.
> But as Shazron mentioned back in April in this thread, JSHint doesn't
> really focus on formatting. (he also suggested to look at jscs
>  as additional tool).
>
>
> Anyway, lets start with using JSHint properly.
> Based on my experience so far, for the existing cordova-lib code I would
> recommend to start with this config:
>
> /* jshint node:true, bitwise:true, undef:true, trailing:true,
> quotmark:true,
>   indent:4, unused:vars, latedef:nofunc
> */
>
> With the following optional tweaks for some files
>  - laxcomma:true // If the file has comma-first formatted parts
>  - sub:true // for files that parse XML and want to use node['prop'] where
> JSHint prefers node.prop.
>  - expr:true // when you want to use variable && someFuncOn(variable);
> (which you shouldn't, but some of the existing code does).
>
> I've just pushed a change
> <
> https://git-wip-us.apache.org/repos/asf?p=cordova-lib.git;a=commit;h=8f880f5d3128e17c8a8f5a4c68798e11f9342172
> >
> with
> this config added to several files to try it out. Works great, I encourage
> people to try it out too.
> Once we get close to passing JSHint check for all the files, we should to
> add a JSHint stage to "npm test".
>
>
> As a reference - some stats from other projects:
> Below are the top 5 most popular .jshintrc files from 619 random* Node.js
> oriented projects on GitHub (lists of flags explicitly set to truthy values
> in .jshintrc).
>
>1. bitwise, browser, camelcase, curly, eqeqeq, esnext, immed, indent,
>latedef, newcap, noarg, node, quotmark, regexp, smarttabs, strict,
>trailing, undef, unused
>2. bitwise, browser, camelcase, curly, eqeqeq, es5, esnext, immed,
>indent, latedef, newcap, noarg, node, quotmark, regexp, smarttabs,
> strict,
>trailing, undef, unused
>3. bitwise, browser, camelcase, curly, eqeqeq, esnext, immed, indent,
>jquery, latedef, newcap, noarg, node, quotmark, regexp, smarttabs,
> strict,
>trailing, undef, unused
>4. bitwise, browser, camelcase, curly, eqeqeq, es5, esnext, globals,
>immed, indent, latedef, newcap, noarg, node, quotmark, regexp,
> smarttabs,
>strict, trailing, undef, unused
>5. boss, curly, eqeqeq, eqnull, es5, immed, latedef, newcap, noarg,
>node, sub, undef
>


Re: plugin test framework

2014-06-17 Thread Piotr Zalewa
One thing more - it would be great if user could create a test using 
test harness app as well. Is it also considered?


Dnia Tue Jun 17 13:27:22 2014 Martin Gonzalez pisze:

It would be a nice to have in the cli, aimed to just setup the right path
in the config.xml, maybe along with an another argument to build,
run/emulate as well.
It sounds great.


2014-06-17 15:21 GMT-05:00 Piotr Zalewa :


Thanks Martin,

Has it been considered to create a separate command "testrun" or similar
which would remove the need to edit the config.xml?

Dnia Tue Jun 17 11:58:33 2014 Michal Mocny pisze:

  Martin, thanks for posting those links.


And I'll look into the INFRA tickets I need to file to set up a repo for
that plugin, since its ready to come out of labs.


On Tue, Jun 17, 2014 at 2:06 PM, Martin Gonzalez <
martin.c.glez.g...@gmail.com> wrote:

  This is the Cordova Plugin Test Framework readme.md, you can catch up

with
the functionality by reading some of the content:

Repository:
https://github.com/apache/cordova-labs

Docs:
https://github.com/apache/cordova-labs/blob/master/README.md

https://github.com/apache/cordova-labs/blob/cdvtest/
cordova-plugin-test-framework/README.md



2014-06-17 12:56 GMT-05:00 Piotr Zalewa :

  a documentation explaining how it's gonna work


Dnia Tue Jun 17 10:51:58 2014 Michal Mocny pisze:

   What do you mean?




On Tue, Jun 17, 2014 at 1:50 PM, Piotr Zalewa 
wrote:

   Is there any predev document?



Dnia Mon Jun 16 18:30:46 2014 Andrew Grieve pisze:

Yeah, really exciting. Thanks for taking this on.




On Mon, Jun 16, 2014 at 3:42 PM, Michal Mocny 
wrote:

Fantastic!



I'll try to keep an eye out on the PR's, and please ping me if you
would
like any help.

-Michal


On Mon, Jun 16, 2014 at 3:25 PM, Marcel Kinard 
wrote:

Hi, after some discussions here with IBM management, we’re going
to

  bring

in a couple extra interns for a week to jumpstart the migration of


the



tests out of mobile-spec into the new plugin test framework. Staci

Cooper
will be leading this effort, and Martin Gonzalez will be a part of


it.





So if you see a bunch of pull requests, this is what it is for.


We’ll



get

the interns to submit an ICLA asap.





--



Piotr Zalewa
Mozilla




  --

Piotr Zalewa
Mozilla





--
Regards,
Martin Gonzalez





--
Piotr Zalewa
Mozilla







--
Piotr Zalewa
Mozilla


Re: [Proposal] Cordova guidelines part of ContributorWorkflow

2014-06-17 Thread Mark Koudritsky
JSHint is awesome and I'm slowly adding the JSHint config lines to almost
every file I touch in cordova-lib.
But as Shazron mentioned back in April in this thread, JSHint doesn't
really focus on formatting. (he also suggested to look at jscs
 as additional tool).


Anyway, lets start with using JSHint properly.
Based on my experience so far, for the existing cordova-lib code I would
recommend to start with this config:

/* jshint node:true, bitwise:true, undef:true, trailing:true, quotmark:true,
  indent:4, unused:vars, latedef:nofunc
*/

With the following optional tweaks for some files
 - laxcomma:true // If the file has comma-first formatted parts
 - sub:true // for files that parse XML and want to use node['prop'] where
JSHint prefers node.prop.
 - expr:true // when you want to use variable && someFuncOn(variable);
(which you shouldn't, but some of the existing code does).

I've just pushed a change

with
this config added to several files to try it out. Works great, I encourage
people to try it out too.
Once we get close to passing JSHint check for all the files, we should to
add a JSHint stage to "npm test".


As a reference - some stats from other projects:
Below are the top 5 most popular .jshintrc files from 619 random* Node.js
oriented projects on GitHub (lists of flags explicitly set to truthy values
in .jshintrc).

   1. bitwise, browser, camelcase, curly, eqeqeq, esnext, immed, indent,
   latedef, newcap, noarg, node, quotmark, regexp, smarttabs, strict,
   trailing, undef, unused
   2. bitwise, browser, camelcase, curly, eqeqeq, es5, esnext, immed,
   indent, latedef, newcap, noarg, node, quotmark, regexp, smarttabs, strict,
   trailing, undef, unused
   3. bitwise, browser, camelcase, curly, eqeqeq, esnext, immed, indent,
   jquery, latedef, newcap, noarg, node, quotmark, regexp, smarttabs, strict,
   trailing, undef, unused
   4. bitwise, browser, camelcase, curly, eqeqeq, es5, esnext, globals,
   immed, indent, latedef, newcap, noarg, node, quotmark, regexp, smarttabs,
   strict, trailing, undef, unused
   5. boss, curly, eqeqeq, eqnull, es5, immed, latedef, newcap, noarg,
   node, sub, undef


Re: plugin test framework

2014-06-17 Thread Martin Gonzalez
It would be a nice to have in the cli, aimed to just setup the right path
in the config.xml, maybe along with an another argument to build,
run/emulate as well.
It sounds great.


2014-06-17 15:21 GMT-05:00 Piotr Zalewa :

> Thanks Martin,
>
> Has it been considered to create a separate command "testrun" or similar
> which would remove the need to edit the config.xml?
>
> Dnia Tue Jun 17 11:58:33 2014 Michal Mocny pisze:
>
>  Martin, thanks for posting those links.
>>
>> And I'll look into the INFRA tickets I need to file to set up a repo for
>> that plugin, since its ready to come out of labs.
>>
>>
>> On Tue, Jun 17, 2014 at 2:06 PM, Martin Gonzalez <
>> martin.c.glez.g...@gmail.com> wrote:
>>
>>  This is the Cordova Plugin Test Framework readme.md, you can catch up
>>> with
>>> the functionality by reading some of the content:
>>>
>>> Repository:
>>> https://github.com/apache/cordova-labs
>>>
>>> Docs:
>>> https://github.com/apache/cordova-labs/blob/master/README.md
>>>
>>> https://github.com/apache/cordova-labs/blob/cdvtest/
>>> cordova-plugin-test-framework/README.md
>>>
>>>
>>>
>>> 2014-06-17 12:56 GMT-05:00 Piotr Zalewa :
>>>
>>>  a documentation explaining how it's gonna work

 Dnia Tue Jun 17 10:51:58 2014 Michal Mocny pisze:

   What do you mean?

>
>
> On Tue, Jun 17, 2014 at 1:50 PM, Piotr Zalewa 
> wrote:
>
>   Is there any predev document?
>
>>
>> Dnia Mon Jun 16 18:30:46 2014 Andrew Grieve pisze:
>>
>>Yeah, really exciting. Thanks for taking this on.
>>
>>
>>>
>>> On Mon, Jun 16, 2014 at 3:42 PM, Michal Mocny 
>>> wrote:
>>>
>>>Fantastic!
>>>
>>>
 I'll try to keep an eye out on the PR's, and please ping me if you
 would
 like any help.

 -Michal


 On Mon, Jun 16, 2014 at 3:25 PM, Marcel Kinard 
 wrote:

Hi, after some discussions here with IBM management, we’re going
 to

  bring
> in a couple extra interns for a week to jumpstart the migration of
>
 the
>>>
 tests out of mobile-spec into the new plugin test framework. Staci
> Cooper
> will be leading this effort, and Martin Gonzalez will be a part of
>
 it.
>>>

> So if you see a bunch of pull requests, this is what it is for.
>
 We’ll
>>>
 get
> the interns to submit an ICLA asap.
>
>
>

--
>>>
>> Piotr Zalewa
>> Mozilla
>>
>>
>>
>  --
 Piotr Zalewa
 Mozilla


>>>
>>>
>>> --
>>> Regards,
>>> Martin Gonzalez
>>>
>>>
>>
> --
> Piotr Zalewa
> Mozilla
>



-- 
Regards,
Martin Gonzalez


Re: plugin test framework

2014-06-17 Thread Piotr Zalewa

Thanks Martin,

Has it been considered to create a separate command "testrun" or 
similar which would remove the need to edit the config.xml?


Dnia Tue Jun 17 11:58:33 2014 Michal Mocny pisze:

Martin, thanks for posting those links.

And I'll look into the INFRA tickets I need to file to set up a repo for
that plugin, since its ready to come out of labs.


On Tue, Jun 17, 2014 at 2:06 PM, Martin Gonzalez <
martin.c.glez.g...@gmail.com> wrote:


This is the Cordova Plugin Test Framework readme.md, you can catch up with
the functionality by reading some of the content:

Repository:
https://github.com/apache/cordova-labs

Docs:
https://github.com/apache/cordova-labs/blob/master/README.md

https://github.com/apache/cordova-labs/blob/cdvtest/cordova-plugin-test-framework/README.md



2014-06-17 12:56 GMT-05:00 Piotr Zalewa :


a documentation explaining how it's gonna work

Dnia Tue Jun 17 10:51:58 2014 Michal Mocny pisze:

  What do you mean?



On Tue, Jun 17, 2014 at 1:50 PM, Piotr Zalewa 
wrote:

  Is there any predev document?


Dnia Mon Jun 16 18:30:46 2014 Andrew Grieve pisze:

   Yeah, really exciting. Thanks for taking this on.




On Mon, Jun 16, 2014 at 3:42 PM, Michal Mocny 
wrote:

   Fantastic!



I'll try to keep an eye out on the PR's, and please ping me if you
would
like any help.

-Michal


On Mon, Jun 16, 2014 at 3:25 PM, Marcel Kinard 
wrote:

   Hi, after some discussions here with IBM management, we’re going to


bring
in a couple extra interns for a week to jumpstart the migration of

the

tests out of mobile-spec into the new plugin test framework. Staci
Cooper
will be leading this effort, and Martin Gonzalez will be a part of

it.


So if you see a bunch of pull requests, this is what it is for.

We’ll

get
the interns to submit an ICLA asap.






  --

Piotr Zalewa
Mozilla





--
Piotr Zalewa
Mozilla





--
Regards,
Martin Gonzalez





--
Piotr Zalewa
Mozilla


[GitHub] cordova-plugin-network-information pull request: fix NullPointerEx...

2014-06-17 Thread ceetah
Github user ceetah commented on the pull request:


https://github.com/apache/cordova-plugin-network-information/pull/10#issuecomment-46358048
  
newbie here. I stumbled upon this error too. and happily found your fix. 
but I do not know how I can add this fix to my application's plugin. how to 
update the plugin with this fix ?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cordova-plugin-device pull request: Update device.js

2014-06-17 Thread purplecabbage
Github user purplecabbage commented on the pull request:

https://github.com/apache/cordova-plugin-device/pull/8#issuecomment-46357475
  
Thanks @shatran 
`name` is not a supported property of the device info passed back.
`info.model` should return `window.clientInformation.platform`
Please verify that this is not being returned correctly, and if it is still 
not working file an issue. 
https://issues.apache.org/jira/browse/CB

Regardless, this pull request cannot be merged. Please close this.



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


Re: plugin test framework

2014-06-17 Thread Michal Mocny
Martin, thanks for posting those links.

And I'll look into the INFRA tickets I need to file to set up a repo for
that plugin, since its ready to come out of labs.


On Tue, Jun 17, 2014 at 2:06 PM, Martin Gonzalez <
martin.c.glez.g...@gmail.com> wrote:

> This is the Cordova Plugin Test Framework readme.md, you can catch up with
> the functionality by reading some of the content:
>
> Repository:
> https://github.com/apache/cordova-labs
>
> Docs:
> https://github.com/apache/cordova-labs/blob/master/README.md
>
> https://github.com/apache/cordova-labs/blob/cdvtest/cordova-plugin-test-framework/README.md
>
>
>
> 2014-06-17 12:56 GMT-05:00 Piotr Zalewa :
>
> > a documentation explaining how it's gonna work
> >
> > Dnia Tue Jun 17 10:51:58 2014 Michal Mocny pisze:
> >
> >  What do you mean?
> >>
> >>
> >> On Tue, Jun 17, 2014 at 1:50 PM, Piotr Zalewa 
> >> wrote:
> >>
> >>  Is there any predev document?
> >>>
> >>> Dnia Mon Jun 16 18:30:46 2014 Andrew Grieve pisze:
> >>>
> >>>   Yeah, really exciting. Thanks for taking this on.
> >>>
> 
> 
>  On Mon, Jun 16, 2014 at 3:42 PM, Michal Mocny 
>  wrote:
> 
>    Fantastic!
> 
> >
> > I'll try to keep an eye out on the PR's, and please ping me if you
> > would
> > like any help.
> >
> > -Michal
> >
> >
> > On Mon, Jun 16, 2014 at 3:25 PM, Marcel Kinard 
> > wrote:
> >
> >   Hi, after some discussions here with IBM management, we’re going to
> >
> >> bring
> >> in a couple extra interns for a week to jumpstart the migration of
> the
> >> tests out of mobile-spec into the new plugin test framework. Staci
> >> Cooper
> >> will be leading this effort, and Martin Gonzalez will be a part of
> it.
> >>
> >> So if you see a bunch of pull requests, this is what it is for.
> We’ll
> >> get
> >> the interns to submit an ICLA asap.
> >>
> >>
> >
> >
>   --
> >>> Piotr Zalewa
> >>> Mozilla
> >>>
> >>>
> >>
> > --
> > Piotr Zalewa
> > Mozilla
> >
>
>
>
> --
> Regards,
> Martin Gonzalez
>


[GitHub] cordova-plugin-device pull request: Use Windows system calls to ge...

2014-06-17 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/cordova-plugin-device/pull/14


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cordova-plugin-file pull request: fix the Windows 8 implementation...

2014-06-17 Thread yaurthek
Github user yaurthek closed the pull request at:

https://github.com/apache/cordova-plugin-file/pull/36


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


Re: plugin test framework

2014-06-17 Thread Martin Gonzalez
This is the Cordova Plugin Test Framework readme.md, you can catch up with
the functionality by reading some of the content:

Repository:
https://github.com/apache/cordova-labs

Docs:
https://github.com/apache/cordova-labs/blob/master/README.md
https://github.com/apache/cordova-labs/blob/cdvtest/cordova-plugin-test-framework/README.md



2014-06-17 12:56 GMT-05:00 Piotr Zalewa :

> a documentation explaining how it's gonna work
>
> Dnia Tue Jun 17 10:51:58 2014 Michal Mocny pisze:
>
>  What do you mean?
>>
>>
>> On Tue, Jun 17, 2014 at 1:50 PM, Piotr Zalewa 
>> wrote:
>>
>>  Is there any predev document?
>>>
>>> Dnia Mon Jun 16 18:30:46 2014 Andrew Grieve pisze:
>>>
>>>   Yeah, really exciting. Thanks for taking this on.
>>>


 On Mon, Jun 16, 2014 at 3:42 PM, Michal Mocny 
 wrote:

   Fantastic!

>
> I'll try to keep an eye out on the PR's, and please ping me if you
> would
> like any help.
>
> -Michal
>
>
> On Mon, Jun 16, 2014 at 3:25 PM, Marcel Kinard 
> wrote:
>
>   Hi, after some discussions here with IBM management, we’re going to
>
>> bring
>> in a couple extra interns for a week to jumpstart the migration of the
>> tests out of mobile-spec into the new plugin test framework. Staci
>> Cooper
>> will be leading this effort, and Martin Gonzalez will be a part of it.
>>
>> So if you see a bunch of pull requests, this is what it is for. We’ll
>> get
>> the interns to submit an ICLA asap.
>>
>>
>
>
  --
>>> Piotr Zalewa
>>> Mozilla
>>>
>>>
>>
> --
> Piotr Zalewa
> Mozilla
>



-- 
Regards,
Martin Gonzalez


[GitHub] cordova-wp8 pull request: CB-6924 Fixed memory leak in WP page nav...

2014-06-17 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/cordova-wp8/pull/41


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


Re: WP8 memory leak

2014-06-17 Thread Jesse
Thanks Staci,
This was a use-case I didn't spend a lot of time on.

@purplecabbage
risingj.com


On Tue, Jun 17, 2014 at 10:49 AM, Staci Cooper  wrote:

> The memory leak was caused by event listeners for PhoneApplicationService.
> I unwired them in CordovaBrowser_Unloaded (pull request:
> https://github.com/apache/cordova-wp8/pull/41). It fixes the leak but I
> want to make sure it doesn't go against the intended behavior.
>
>
> On Tue, Jun 17, 2014 at 11:58 AM, Staci Cooper 
> wrote:
>
> > Hey,
> >
> > I'm looking into CB-6924  >,
> > where I'm seeing a memory leak in WP8 when navigating back and forth
> from a
> > native to a hybrid page. A new page is being created every time you
> > navigate to the Cordova page, and none of them are garbage collected.
> >
> > Is this the intended behavior? When a new page is constructed, a new
> > CordovaView is being created with it. The CordovaView has a bool called
> > 'IsBrowserInitialized'
> > <
> https://github.com/apache/cordova-wp8/blob/master/wp8/template/cordovalib/CordovaView.xaml.cs#L43
> >which,
> > according to the comment, "prevents data clearing during page
> transitions".
> > It is set to true in CordovaBrowser_Loaded, or causes the handler to
> return
> > if it is already set to true. I'm not sure if 'page transitions' refers
> to
> > transitions within the CordovaBrowser or at a higher level.
> >
>


Re: [Proposal] Cordova guidelines part of ContributorWorkflow

2014-06-17 Thread Brian LeRoux
No regrets. ;)


On Tue, Jun 17, 2014 at 10:49 AM, Michal Mocny  wrote:

> Don't tell me you would accept patches written using emacs?
>
>
> On Tue, Jun 17, 2014 at 12:45 PM, Brian LeRoux  wrote:
>
> > +1
> >
> > For historical context, there was a time when finding/retaining
> committers
> > was more important than concern about the fickle style of JS that came
> into
> > fashion that week. We would even accept a pull request if it had tabs
> > instead of spaces!
> >
> > But ya lets go bananas on JSHint. Cleaning up those warnings would be a
> > good 'first bug' for new committers.
> >
> >
> >
> > On Mon, Jun 16, 2014 at 6:52 PM, Ian Clelland 
> > wrote:
> >
> > > /* jshint laxcomma: true */
> > >
> > > at the top of a JS file should do it.
> > >
> > > Ref: http://www.jshint.com/docs/options/#laxcomma
> > >
> > >
> > > On Mon, Jun 16, 2014 at 9:34 PM, Andrew Grieve 
> > > wrote:
> > >
> > > > I haven't seen our style guide followed, and generally don't think
> > style
> > > is
> > > > a thing that can really be enforced without tools or code review. How
> > > about
> > > > deleting the wiki page and doubling down on jshint? Can we tell
> jshint
> > to
> > > > force ;s while allowing comma-first?
> > > >
> > > >
> > > > On Mon, Jun 16, 2014 at 5:00 PM, Mark Koudritsky 
> > > > wrote:
> > > >
> > > > > To make it clear, I don't really care whether to use semicolons or
> > not,
> > > > but
> > > > > I do want cordova to have a style guide which I can follow without
> > > > > surprising people too much. Which is obviously not the case with
> our
> > > > > current style guide :)
> > > > >
> > > >
> > >
> >
>


Re: plugin test framework

2014-06-17 Thread Piotr Zalewa

a documentation explaining how it's gonna work

Dnia Tue Jun 17 10:51:58 2014 Michal Mocny pisze:

What do you mean?


On Tue, Jun 17, 2014 at 1:50 PM, Piotr Zalewa  wrote:


Is there any predev document?

Dnia Mon Jun 16 18:30:46 2014 Andrew Grieve pisze:

  Yeah, really exciting. Thanks for taking this on.



On Mon, Jun 16, 2014 at 3:42 PM, Michal Mocny 
wrote:

  Fantastic!


I'll try to keep an eye out on the PR's, and please ping me if you would
like any help.

-Michal


On Mon, Jun 16, 2014 at 3:25 PM, Marcel Kinard 
wrote:

  Hi, after some discussions here with IBM management, we’re going to

bring
in a couple extra interns for a week to jumpstart the migration of the
tests out of mobile-spec into the new plugin test framework. Staci
Cooper
will be leading this effort, and Martin Gonzalez will be a part of it.

So if you see a bunch of pull requests, this is what it is for. We’ll
get
the interns to submit an ICLA asap.







--
Piotr Zalewa
Mozilla





--
Piotr Zalewa
Mozilla


Re: plugin test framework

2014-06-17 Thread Michal Mocny
What do you mean?


On Tue, Jun 17, 2014 at 1:50 PM, Piotr Zalewa  wrote:

> Is there any predev document?
>
> Dnia Mon Jun 16 18:30:46 2014 Andrew Grieve pisze:
>
>  Yeah, really exciting. Thanks for taking this on.
>>
>>
>> On Mon, Jun 16, 2014 at 3:42 PM, Michal Mocny 
>> wrote:
>>
>>  Fantastic!
>>>
>>> I'll try to keep an eye out on the PR's, and please ping me if you would
>>> like any help.
>>>
>>> -Michal
>>>
>>>
>>> On Mon, Jun 16, 2014 at 3:25 PM, Marcel Kinard 
>>> wrote:
>>>
>>>  Hi, after some discussions here with IBM management, we’re going to
 bring
 in a couple extra interns for a week to jumpstart the migration of the
 tests out of mobile-spec into the new plugin test framework. Staci
 Cooper
 will be leading this effort, and Martin Gonzalez will be a part of it.

 So if you see a bunch of pull requests, this is what it is for. We’ll
 get
 the interns to submit an ICLA asap.

>>>
>>>
>>
> --
> Piotr Zalewa
> Mozilla
>


Re: plugin test framework

2014-06-17 Thread Piotr Zalewa

Is there any predev document?

Dnia Mon Jun 16 18:30:46 2014 Andrew Grieve pisze:

Yeah, really exciting. Thanks for taking this on.


On Mon, Jun 16, 2014 at 3:42 PM, Michal Mocny  wrote:


Fantastic!

I'll try to keep an eye out on the PR's, and please ping me if you would
like any help.

-Michal


On Mon, Jun 16, 2014 at 3:25 PM, Marcel Kinard  wrote:


Hi, after some discussions here with IBM management, we’re going to bring
in a couple extra interns for a week to jumpstart the migration of the
tests out of mobile-spec into the new plugin test framework. Staci Cooper
will be leading this effort, and Martin Gonzalez will be a part of it.

So if you see a bunch of pull requests, this is what it is for. We’ll get
the interns to submit an ICLA asap.






--
Piotr Zalewa
Mozilla


Re: staff change

2014-06-17 Thread Michael Brooks
Thanks for the update Marcel.

James, it's been great working with you and I hope we still cross paths!
It's incredibly important for all of us to use the product/tool that we
create, so I'm happy to hear that you're stepping into the consumer-side!
Don't be a stranger to submitting issues and nagging us to fix the ones
that impact your work!

Eric, awesome to meet you! Straight out of college and into open source.
You're set!

Michael


On Mon, Jun 16, 2014 at 12:43 PM, Michal Mocny  wrote:

> Thanks for the update.   See you around James, and hello Eric!
>
>
> On Mon, Jun 16, 2014 at 3:40 PM, Marcel Kinard  wrote:
>
> > Wanted to let the community know about a staff change here at IBM.
> >
> > James Jong, who has been working in the iOS area, is transferring to a
> > different department internally to work on a new product. He will be
> using
> > Cordova and writing some new native code for the product, so he’s a
> natural
> > fit, though we are sad to see him step away from the Cordova team. We
> > should expect to see James from time to time, since he’s now wearing a
> > consumer hat. His cube is still next to mine, so I can throw things at
> him
> > if needed.
> >
> > We just gained a new person to help backfill James. Eric Weiterman just
> > graduated from college and is joining us. Eric is new to iOS, but is
> > training and coming up to speed. Friday he deployed mobile-spec to an
> > iPhone and ran through the tests ;-) We should see pull requests coming
> > from him soon, and he is exercising our README.md’s.
> >
> > Thanks!
> >
> >
> >
>


Re: WP8 memory leak

2014-06-17 Thread Staci Cooper
The memory leak was caused by event listeners for PhoneApplicationService.
I unwired them in CordovaBrowser_Unloaded (pull request:
https://github.com/apache/cordova-wp8/pull/41). It fixes the leak but I
want to make sure it doesn't go against the intended behavior.


On Tue, Jun 17, 2014 at 11:58 AM, Staci Cooper  wrote:

> Hey,
>
> I'm looking into CB-6924 ,
> where I'm seeing a memory leak in WP8 when navigating back and forth from a
> native to a hybrid page. A new page is being created every time you
> navigate to the Cordova page, and none of them are garbage collected.
>
> Is this the intended behavior? When a new page is constructed, a new
> CordovaView is being created with it. The CordovaView has a bool called
> 'IsBrowserInitialized'
> which,
> according to the comment, "prevents data clearing during page transitions".
> It is set to true in CordovaBrowser_Loaded, or causes the handler to return
> if it is already set to true. I'm not sure if 'page transitions' refers to
> transitions within the CordovaBrowser or at a higher level.
>


Re: [Proposal] Cordova guidelines part of ContributorWorkflow

2014-06-17 Thread Michal Mocny
Don't tell me you would accept patches written using emacs?


On Tue, Jun 17, 2014 at 12:45 PM, Brian LeRoux  wrote:

> +1
>
> For historical context, there was a time when finding/retaining committers
> was more important than concern about the fickle style of JS that came into
> fashion that week. We would even accept a pull request if it had tabs
> instead of spaces!
>
> But ya lets go bananas on JSHint. Cleaning up those warnings would be a
> good 'first bug' for new committers.
>
>
>
> On Mon, Jun 16, 2014 at 6:52 PM, Ian Clelland 
> wrote:
>
> > /* jshint laxcomma: true */
> >
> > at the top of a JS file should do it.
> >
> > Ref: http://www.jshint.com/docs/options/#laxcomma
> >
> >
> > On Mon, Jun 16, 2014 at 9:34 PM, Andrew Grieve 
> > wrote:
> >
> > > I haven't seen our style guide followed, and generally don't think
> style
> > is
> > > a thing that can really be enforced without tools or code review. How
> > about
> > > deleting the wiki page and doubling down on jshint? Can we tell jshint
> to
> > > force ;s while allowing comma-first?
> > >
> > >
> > > On Mon, Jun 16, 2014 at 5:00 PM, Mark Koudritsky 
> > > wrote:
> > >
> > > > To make it clear, I don't really care whether to use semicolons or
> not,
> > > but
> > > > I do want cordova to have a style guide which I can follow without
> > > > surprising people too much. Which is obviously not the case with our
> > > > current style guide :)
> > > >
> > >
> >
>


[GitHub] cordova-wp8 pull request: CB-6924 Fixed memory leak in WP page nav...

2014-06-17 Thread stacic
Github user stacic commented on the pull request:

https://github.com/apache/cordova-wp8/pull/41#issuecomment-46341089
  
I built mobile-spec with these changes and didn't see any new tests failing.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cordova-wp8 pull request: CB-6924 Fixed memory leak in WP page nav...

2014-06-17 Thread stacic
GitHub user stacic opened a pull request:

https://github.com/apache/cordova-wp8/pull/41

CB-6924 Fixed memory leak in WP page navigation

Occurred when navigating back and forth from native to hybrid page.

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/stacic/cordova-wp8 CB-6924

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/cordova-wp8/pull/41.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #41


commit 0c5f0e393db026633afd89fec0684c0021d19df6
Author: Staci Cooper 
Date:   2014-06-17T17:43:54Z

CB-6924 Fixed memory leak in WP page navigation

Occurred when navigating back and forth from native to hybrid page.




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cordova-lib pull request: CB-6954 Share events.js between cordova ...

2014-06-17 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/cordova-lib/pull/31


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


Re: [Proposal] Cordova guidelines part of ContributorWorkflow

2014-06-17 Thread Brian LeRoux
+1

For historical context, there was a time when finding/retaining committers
was more important than concern about the fickle style of JS that came into
fashion that week. We would even accept a pull request if it had tabs
instead of spaces!

But ya lets go bananas on JSHint. Cleaning up those warnings would be a
good 'first bug' for new committers.



On Mon, Jun 16, 2014 at 6:52 PM, Ian Clelland 
wrote:

> /* jshint laxcomma: true */
>
> at the top of a JS file should do it.
>
> Ref: http://www.jshint.com/docs/options/#laxcomma
>
>
> On Mon, Jun 16, 2014 at 9:34 PM, Andrew Grieve 
> wrote:
>
> > I haven't seen our style guide followed, and generally don't think style
> is
> > a thing that can really be enforced without tools or code review. How
> about
> > deleting the wiki page and doubling down on jshint? Can we tell jshint to
> > force ;s while allowing comma-first?
> >
> >
> > On Mon, Jun 16, 2014 at 5:00 PM, Mark Koudritsky 
> > wrote:
> >
> > > To make it clear, I don't really care whether to use semicolons or not,
> > but
> > > I do want cordova to have a style guide which I can follow without
> > > surprising people too much. Which is obviously not the case with our
> > > current style guide :)
> > >
> >
>


WP8 memory leak

2014-06-17 Thread Staci Cooper
Hey,

I'm looking into CB-6924 ,
where I'm seeing a memory leak in WP8 when navigating back and forth from a
native to a hybrid page. A new page is being created every time you
navigate to the Cordova page, and none of them are garbage collected.

Is this the intended behavior? When a new page is constructed, a new
CordovaView is being created with it. The CordovaView has a bool called
'IsBrowserInitialized'
which,
according to the comment, "prevents data clearing during page transitions".
It is set to true in CordovaBrowser_Loaded, or causes the handler to return
if it is already set to true. I'm not sure if 'page transitions' refers to
transitions within the CordovaBrowser or at a higher level.


Re: File-transfer: delete target file on process error

2014-06-17 Thread Javier Puerto
I think it's better to use the error callback because for cached resources
doesn't makes sense to use the "Entry" as parameter as the target will not
exists..There's no error but the file transfer was unable to download
anything due to the 304 response so IMO the error callback could do the job.


2014-06-17 16:27 GMT+02:00 Andrew Grieve :

> How about adding a second parameter to the callback? Android and iOS
> bridges both support this natively, and you can simulate it on other
> platforms by manually unpacking the parameters in your own callback.
>
>
> On Tue, Jun 17, 2014 at 4:18 AM, Javier Puerto  wrote:
>
> > 2014-06-16 17:01 GMT+02:00 Andrew Grieve :
> >
> > > I think this behaviour has been around for a while, and makes sense in
> > the
> > > majority of cases.
> >
> >
> > Yep, I did a "git blame" and this fragment of code was there from the
> > beginning.
> >
> >
> > > Best practice is to download to a temporary location,
> > > and then upon success move the file to its final spot.
> > >
> >
> > Yes, this is what I will have to do at the end. The thing is that I want
> to
> > avoid a double step process. Anyway I'm still thinking that a hard coded
> > and undocumented behaviour is not a good practice neither, mostly because
> > there's the tools for the developer to act as he needs with the success
> or
> > error callback. It's about flexibility.
> >
> >
> > >
> > > That said, I think it'd be fine to add an option for not delete on
> error.
> > >
> >
> > It seems like the file transfer download is oriented to use a temporary
> > directory so it's fine for me as is (keep it simple). I think that an
> > explanation in the plugin documentation should be great so everyone can
> > figure how to use the download.
> >
> > About the issue CB-6928, my patch it's not valid for me as I will use the
> > temporary directory now and probably for everyone so I will have to
> cancel
> > the pull request. The problem is still there but I wonder how can we fix
> it
> > if the success callback argument is an "Entry" object, the ideal should
> be
> > to be able to communicate the caching status. I will change the patch to
> > use the error callback to communicate the caching status, it's not an
> error
> > but I don't see other way. I will add also the documentation for the new
> > caching status code and open a new pull request.
> >
> >
> > >
> > >
> > > On Mon, Jun 16, 2014 at 5:39 AM, Javier Puerto 
> > wrote:
> > >
> > > > Hi Cordova developers,
> > > >
> > > > I'm creating a system to download/update several resources from a
> > server
> > > to
> > > > the device and I've observe a behaviour that breaks my use case.
> > > >
> > > > After fix the issue CB-6928, I'm able to download/update all the
> > > resources
> > > > without problems. My next test was to try to download the resources
> but
> > > > with no server response (stopped). I've found that the plugin is
> > deleting
> > > > my target file silently because there's was an error.
> > > >
> > > > I think that the developer should be the responsible to delete or
> leave
> > > the
> > > > "corrupted" file because the file-transfer plugin already
> communicates
> > > the
> > > > error, I don't think that the hardcoded behaviour is a good solution.
> > >  What
> > > > do you think?
> > > > I can open a new issue and provide the patch and test case (Android
> > only)
> > > >
> > > > Best regards.
> > > >
> > >
> >
>


Re: File-transfer: delete target file on process error

2014-06-17 Thread Andrew Grieve
How about adding a second parameter to the callback? Android and iOS
bridges both support this natively, and you can simulate it on other
platforms by manually unpacking the parameters in your own callback.


On Tue, Jun 17, 2014 at 4:18 AM, Javier Puerto  wrote:

> 2014-06-16 17:01 GMT+02:00 Andrew Grieve :
>
> > I think this behaviour has been around for a while, and makes sense in
> the
> > majority of cases.
>
>
> Yep, I did a "git blame" and this fragment of code was there from the
> beginning.
>
>
> > Best practice is to download to a temporary location,
> > and then upon success move the file to its final spot.
> >
>
> Yes, this is what I will have to do at the end. The thing is that I want to
> avoid a double step process. Anyway I'm still thinking that a hard coded
> and undocumented behaviour is not a good practice neither, mostly because
> there's the tools for the developer to act as he needs with the success or
> error callback. It's about flexibility.
>
>
> >
> > That said, I think it'd be fine to add an option for not delete on error.
> >
>
> It seems like the file transfer download is oriented to use a temporary
> directory so it's fine for me as is (keep it simple). I think that an
> explanation in the plugin documentation should be great so everyone can
> figure how to use the download.
>
> About the issue CB-6928, my patch it's not valid for me as I will use the
> temporary directory now and probably for everyone so I will have to cancel
> the pull request. The problem is still there but I wonder how can we fix it
> if the success callback argument is an "Entry" object, the ideal should be
> to be able to communicate the caching status. I will change the patch to
> use the error callback to communicate the caching status, it's not an error
> but I don't see other way. I will add also the documentation for the new
> caching status code and open a new pull request.
>
>
> >
> >
> > On Mon, Jun 16, 2014 at 5:39 AM, Javier Puerto 
> wrote:
> >
> > > Hi Cordova developers,
> > >
> > > I'm creating a system to download/update several resources from a
> server
> > to
> > > the device and I've observe a behaviour that breaks my use case.
> > >
> > > After fix the issue CB-6928, I'm able to download/update all the
> > resources
> > > without problems. My next test was to try to download the resources but
> > > with no server response (stopped). I've found that the plugin is
> deleting
> > > my target file silently because there's was an error.
> > >
> > > I think that the developer should be the responsible to delete or leave
> > the
> > > "corrupted" file because the file-transfer plugin already communicates
> > the
> > > error, I don't think that the hardcoded behaviour is a good solution.
> >  What
> > > do you think?
> > > I can open a new issue and provide the patch and test case (Android
> only)
> > >
> > > Best regards.
> > >
> >
>


[GitHub] cordova-app-harness pull request: [CB6947] move app directory by d...

2014-06-17 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/cordova-app-harness/pull/1


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cordova-plugin-media-capture pull request: CB-6944: Android: Fix f...

2014-06-17 Thread dzeims
GitHub user dzeims opened a pull request:

https://github.com/apache/cordova-plugin-media-capture/pull/18

CB-6944: Android: Fix file permission for camera app image media capture



You can merge this pull request into a Git repository by running:

$ git pull https://github.com/dzeims/cordova-plugin-media-capture master

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/cordova-plugin-media-capture/pull/18.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #18


commit 2467b6ffe559de2e3563bbde8c623ee137339b30
Author: dzeims 
Date:   2014-06-17T13:35:59Z

CB-6944: Android: Fix file permission for camera app image media capture




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cordova-lib pull request: CB-6954 Share events.js between cordova ...

2014-06-17 Thread sgrebnov
GitHub user sgrebnov opened a pull request:

https://github.com/apache/cordova-lib/pull/31

CB-6954 Share events.js between cordova and plugman

https://issues.apache.org/jira/browse/CB-6954

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/MSOpenTech/cordova-lib CB-6954

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/cordova-lib/pull/31.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #31


commit 97d8a86eb5c39f94e43d071630d04292db054757
Author: sgrebnov 
Date:   2014-06-17T13:32:24Z

CB-6954 Share events.js between cordova and plugman




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


Early Gradle successes

2014-06-17 Thread Ian Clelland
I've been playing with Gradle builds for Cordova Android, and have managed
to put together an initial working build system, which I've committted in
the 4.0.x branch.

If anyone wants to test it out, check out and build a project with that
branch. Then, from the platforms/android dir, just run

./gradlew build

(You may have to set your JAVA_HOME directory; I usually just prefix the
command, and run it like

JAVA_HOME=`/usr/libexec/java_home` ./gradlew build
)

gradlew is a wrapper script, which on first run will download all of the
bits that are needed. Subsequent runs will be faster and not require
network access. Eventually this command would be the one run by the build
scripts.

My next step is to get is to get it working with Crosswalk as well -- I
have it working locally (and assembling architecture-specific APKs!), but
it required some changes to the Crosswalk engine plugin before it would
build.

If anyone wants to try it out, feedback is welcomed.

Thanks,
Ian


[GitHub] cordova-plugin-inappbrowser pull request: Fix opening of files in ...

2014-06-17 Thread hkuiyo
Github user hkuiyo commented on a diff in the pull request:


https://github.com/apache/cordova-plugin-inappbrowser/pull/50#discussion_r13853573
  
--- Diff: src/wp/InAppBrowser.cs ---
@@ -250,6 +251,30 @@ private void ShowCordovaBrowser(string url)
 }
 }
 
+private string FixUrl(string url)
+{
+const string IsolatedStorageProtocol = "x-wmapp0:/"; // NOTE: 
1 slash, due to paths being screwed up (for example: x-wmapp:/tmp//test.doc, 
instead of x-wmapp://tmp/test.doc)
+string DoubleSeparator = 
Path.DirectorySeparatorChar.ToString(CultureInfo.InvariantCulture) + 
Path.DirectorySeparatorChar;
+
+// Remove x-wmapp0 protocol, making this a relative URL, 
keeping the original path
+if (url.StartsWith(IsolatedStorageProtocol, 
StringComparison.OrdinalIgnoreCase))
+{
+url = url.Substring(IsolatedStorageProtocol.Length);
+}
+
+// Replace forward slashes with environment slashes + strip 
double slashes
+url = url.Replace('/', Path.DirectorySeparatorChar);
+while (url.IndexOf(DoubleSeparator) != -1)
+{
+url = url.Replace(DoubleSeparator, 
Path.DirectorySeparatorChar.ToString(CultureInfo.InvariantCulture);
--- End diff --

Oops, there should be an extra ) before the ;.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cordova-plugin-inappbrowser pull request: Fix opening of files in ...

2014-06-17 Thread hkuiyo
Github user hkuiyo closed the pull request at:

https://github.com/apache/cordova-plugin-inappbrowser/pull/48


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cordova-plugin-inappbrowser pull request: Fix opening of files in ...

2014-06-17 Thread hkuiyo
Github user hkuiyo commented on the pull request:


https://github.com/apache/cordova-plugin-inappbrowser/pull/48#issuecomment-46294530
  
See pull request #50 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cordova-plugin-inappbrowser pull request: Fix opening of files in ...

2014-06-17 Thread hkuiyo
GitHub user hkuiyo opened a pull request:

https://github.com/apache/cordova-plugin-inappbrowser/pull/50

Fix opening of files in Windows Phone 8.

The files weren't being opened, because of UriKind.Absolute.

For example: entry.toNativeURL() results in "x-wmapp0://example.pdf/".
Using the existing code, "pathUri.AbsolutePath" results in "/" (because 
that is the path of the above URL).
And that is definitely NOT the URL we wanted to open...

The code now checks this, reformats the URL and eventually uses the 
supplied URL to open the file.

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/hkuiyo/cordova-plugin-inappbrowser patch-1

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/cordova-plugin-inappbrowser/pull/50.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #50


commit e1e123178cdea68919e4b71be5668e41c1cdad5b
Author: hkuiyo 
Date:   2014-06-17T11:17:53Z

Fix opening of files in Windows Phone 8.

The files weren't being opened, because of UriKind.Absolute.

For example: entry.toNativeURL() results in "x-wmapp0://example.pdf/".
Using the existing code, "pathUri.AbsolutePath" results in "/" (because 
that is the path of the above URL).
And that is definitely NOT the URL we wanted to open...

The code now checks this, reformats the URL and eventually uses the 
supplied URL to open the file.




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cordova-plugin-splashscreen pull request: Fix logic when setting t...

2014-06-17 Thread mlegenhausen
Github user mlegenhausen commented on the pull request:


https://github.com/apache/cordova-plugin-splashscreen/pull/19#issuecomment-46285627
  
+1


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cordova-plugin-file-transfer pull request: CB-6928: Implements NOT...

2014-06-17 Thread jpuerto
Github user jpuerto commented on the pull request:


https://github.com/apache/cordova-plugin-file-transfer/pull/31#issuecomment-46279769
  
As commented in the dev mailing list, this patch is not valid. We need to 
return the caching status with the error callback so the developer can act 
accordingly.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cordova-plugin-file-transfer pull request: CB-6928: Implements NOT...

2014-06-17 Thread jpuerto
Github user jpuerto closed the pull request at:

https://github.com/apache/cordova-plugin-file-transfer/pull/31


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


Re: File-transfer: delete target file on process error

2014-06-17 Thread Javier Puerto
2014-06-16 17:01 GMT+02:00 Andrew Grieve :

> I think this behaviour has been around for a while, and makes sense in the
> majority of cases.


Yep, I did a "git blame" and this fragment of code was there from the
beginning.


> Best practice is to download to a temporary location,
> and then upon success move the file to its final spot.
>

Yes, this is what I will have to do at the end. The thing is that I want to
avoid a double step process. Anyway I'm still thinking that a hard coded
and undocumented behaviour is not a good practice neither, mostly because
there's the tools for the developer to act as he needs with the success or
error callback. It's about flexibility.


>
> That said, I think it'd be fine to add an option for not delete on error.
>

It seems like the file transfer download is oriented to use a temporary
directory so it's fine for me as is (keep it simple). I think that an
explanation in the plugin documentation should be great so everyone can
figure how to use the download.

About the issue CB-6928, my patch it's not valid for me as I will use the
temporary directory now and probably for everyone so I will have to cancel
the pull request. The problem is still there but I wonder how can we fix it
if the success callback argument is an "Entry" object, the ideal should be
to be able to communicate the caching status. I will change the patch to
use the error callback to communicate the caching status, it's not an error
but I don't see other way. I will add also the documentation for the new
caching status code and open a new pull request.


>
>
> On Mon, Jun 16, 2014 at 5:39 AM, Javier Puerto  wrote:
>
> > Hi Cordova developers,
> >
> > I'm creating a system to download/update several resources from a server
> to
> > the device and I've observe a behaviour that breaks my use case.
> >
> > After fix the issue CB-6928, I'm able to download/update all the
> resources
> > without problems. My next test was to try to download the resources but
> > with no server response (stopped). I've found that the plugin is deleting
> > my target file silently because there's was an error.
> >
> > I think that the developer should be the responsible to delete or leave
> the
> > "corrupted" file because the file-transfer plugin already communicates
> the
> > error, I don't think that the hardcoded behaviour is a good solution.
>  What
> > do you think?
> > I can open a new issue and provide the patch and test case (Android only)
> >
> > Best regards.
> >
>