incubator-callback-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shazron Abdullah (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (CB-877) Opening a .doc file under iOS causes the file system API to break (and any other plugins that may use NSMutableArray pop)
Date Wed, 13 Jun 2012 23:09:42 GMT

     [ https://issues.apache.org/jira/browse/CB-877?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Shazron Abdullah resolved CB-877.
---------------------------------

    Resolution: Fixed

Fix commit - http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/commit/72c8f18b
                
> Opening a .doc file under iOS causes the file system API to break (and any other plugins
that may use NSMutableArray pop)
> -------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CB-877
>                 URL: https://issues.apache.org/jira/browse/CB-877
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: iOS
>    Affects Versions: 1.4.0
>         Environment: Simple project that opens a word document in iOS 5.0+
>            Reporter: James Rose
>            Assignee: Shazron Abdullah
>            Priority: Critical
>             Fix For: 1.9.0
>
>
> After getting the UIWebView to navigate to a .doc the FileSystem API breaks.
> in javascript:
> FileSystem.root.getFile(<path to word document>, { create: false }, function (fs_file){
>     window.location = fs_file.toURI();
> }
> Then in the shouldStartLoadWithRequest method open the word doc, and after x seconds
redirect it the home page again (faster than creating a new view controller etc).
> Once back on the home page try call any of the FileSystem API's and they won't run the
success or failure callbacks.
> It seems that the control that opens the word documents overrides the NSMutableArray
pop implementation added in NSMutableArray+QueueAdditions, it no longer returns the first
element in the array, instead it returns the last element (checking the function pointer for
pop before/after opening the word document returns different results).
> CDVFile seems to be the only code where the pop method is used, and seems to be the only
part that is broken.
> Suggested fix: rather than calling [arguments pop] use [arguments objectAtIndex:0]
> Side note:
> Calling [arguments objectAtIndex:0] followed by VERIFY_ARGUMENTS won't call the callbacks
if they exist either, in the verifyArgument method in CDVPlugin, if you pass a callbackId
to the method it then does:
> NSString* callbackId = [arguments objectAtIndex:0];
> and returns the failure to that callbackId rather than the one you specified, since the
callbackId has been removed from the array it will try callback on the first parameter.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message