You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by DanielFreiburger <gi...@git.apache.org> on 2014/04/10 13:58:05 UTC

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

GitHub user DanielFreiburger opened a pull request:

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

    Update Metadata.js

    File was not updated correct after changing "modificationTime" to "lastModifiedDate"

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

    $ git pull https://github.com/DanielFreiburger/cordova-plugin-file patch-2

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

    https://github.com/apache/cordova-plugin-file/pull/39.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 #39
    
----
commit 370c0f6c94fb845c778f0ff0f2c7eb5b7acb2753
Author: DanielFreiburger <da...@europapark.de>
Date:   2014-04-10T11:58:00Z

    Update Metadata.js
    
    File was not updated correct after changing "modificationTime" to "lastModifiedDate"

----


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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

Posted by shazron <gi...@git.apache.org>.
Github user shazron commented on the pull request:

    https://github.com/apache/cordova-plugin-file/pull/39#issuecomment-44431873
  
    Hmm File.js represents the File interface in the File API spec: http://www.w3.org/TR/FileAPI/#file and it does specify lastModifiedDate, which is correct.
    
    FileEntry.file is correct, it should return a File object, so that's fine -- but it has a bug in it in how it constructs the File object. Since it is calling the getMetadata function, the call to get the date should be f.modificationTime instead of f.lastModifiedDate (since the returned object to the successcallback is a Metadata object): https://github.com/apache/cordova-plugin-file/blob/767e2c5919ad92e5c94c1b06f19a21b90d8277f1/www/FileEntry.js#L71
    



---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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

Posted by DanielFreiburger <gi...@git.apache.org>.
Github user DanielFreiburger commented on the pull request:

    https://github.com/apache/cordova-plugin-file/pull/39#issuecomment-44406214
  
    In File.js always "lastModifiedDate" is used,
    in Metadata.js always "modificationTime" is used
    but there is no correlation between these two.
    So one of the two must be wrong.
    After creating a correlation between the two by changing Metadata.js line 29 from:
    this.modificationTime = new Date(metadata.modificationTime);
    to
    this.modificationTime = new Date(metadata.lastModifiedDate);
    everything is fine.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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

Posted by shazron <gi...@git.apache.org>.
Github user shazron commented on the pull request:

    https://github.com/apache/cordova-plugin-file/pull/39#issuecomment-41215022
  
    @alessandronunes this was a bug in the File plugin. It should be fixed in the dev branch, or wait an hour or so when the new plugin version gets published.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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

Posted by shazron <gi...@git.apache.org>.
Github user shazron commented on the pull request:

    https://github.com/apache/cordova-plugin-file/pull/39#issuecomment-41215140
  
    Woops, it just happened - plugins are released! http://cordova.apache.org/news/2014/04/23/plugins.release.html


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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

Posted by alessandronunes <gi...@git.apache.org>.
Github user alessandronunes commented on the pull request:

    https://github.com/apache/cordova-plugin-file/pull/39#issuecomment-41214122
  
    What about the "com.apple.MobileBackup"? I'm trying to set it but neither the success or the fail callback function is being called.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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

Posted by alessandronunes <gi...@git.apache.org>.
Github user alessandronunes commented on the pull request:

    https://github.com/apache/cordova-plugin-file/pull/39#issuecomment-41215371
  
    Thanks Shaz! Do you know when, usually, Phonegap gets updated after 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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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

Posted by shazron <gi...@git.apache.org>.
Github user shazron commented on the pull request:

    https://github.com/apache/cordova-plugin-file/pull/39#issuecomment-40853736
  
    Not sure this is correct. The spec says it should be "modificationTime": http://dev.w3.org/2009/dap/file-system/pub/FileSystem/
    
    The js function that uses Metadata:
    https://github.com/apache/cordova-plugin-file/blob/21e119692ab9c9fb2912dc69e2c6d4b05307e3e2/www/Entry.js#L65-L75
    
    On iOS, it is modificationTime:
    https://github.com/apache/cordova-plugin-file/blob/21e119692ab9c9fb2912dc69e2c6d4b05307e3e2/src/ios/CDVLocalFilesystem.m#L278
    
    But, on Android it's lastModifiedDate:
    https://github.com/apache/cordova-plugin-file/blob/757e692ff02cc21a94452af414e33feda9a09157/src/android/LocalFilesystem.java#L297
    
    So I think this is a bug in Android.



---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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

Posted by alessandronunes <gi...@git.apache.org>.
Github user alessandronunes commented on the pull request:

    https://github.com/apache/cordova-plugin-file/pull/39#issuecomment-41215819
  
    Thanks again. Good job!


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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

Posted by clelland <gi...@git.apache.org>.
Github user clelland commented on the pull request:

    https://github.com/apache/cordova-plugin-file/pull/39#issuecomment-45775108
  
    I've created [CB-6922](https://issues.apache.org/jira/browse/CB-6922) for this -- it was certainly a problem in Android.
    
    The trouble, as Shaz identified, is that *both* the File API and the FileEntry API have a method to get metadata for a file, and they use inconsistent names for the timestamp.
    
    I've committed a different fix, which just makes use of getFileMetadata for both functions (on all platforms) and changes the key names in JavaScript before instantiating the Metadata object. This should ensure consistent behaviour across all platforms.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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

Posted by shazron <gi...@git.apache.org>.
Github user shazron commented on the pull request:

    https://github.com/apache/cordova-plugin-file/pull/39#issuecomment-41215581
  
    For Plugins, we aim for a weekly release, however prior to this, our last one was over 5 weeks ago I think. For the core platforms, we used to aim for a monthly release, but now it is indeterminate.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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

Posted by clelland <gi...@git.apache.org>.
Github user clelland commented on the pull request:

    https://github.com/apache/cordova-plugin-file/pull/39#issuecomment-44056947
  
    It looks like the mobilespec test for this just checked that `metadata.modificationTime instanceof Date` was true. Unfortunately,
    
        new Date(undefined) instanceof Date === true
    
    So it never failed. :(
    
    Definitely a bug in Android; I'll fix that for the next release.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

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


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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

Posted by shazron <gi...@git.apache.org>.
Github user shazron commented on the pull request:

    https://github.com/apache/cordova-plugin-file/pull/39#issuecomment-40853781
  
    Also, Android has all these extra properties that are not part of the spec:
    https://github.com/apache/cordova-plugin-file/blob/757e692ff02cc21a94452af414e33feda9a09157/src/android/LocalFilesystem.java#L294-L296


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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

Posted by clelland <gi...@git.apache.org>.
Github user clelland commented on the pull request:

    https://github.com/apache/cordova-plugin-file/pull/39#issuecomment-46579029
  
    This fix has been committed, and the tests are ensuring that the correct keys appear in the callbacks. You can close this pull request, I think.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---