cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ken Naito (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CB-14110) Cordova Plugin File not reading large json files correctly - android
Date Fri, 01 Jun 2018 06:23:00 GMT

    [ https://issues.apache.org/jira/browse/CB-14110?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16497635#comment-16497635
] 

Ken Naito commented on CB-14110:
--------------------------------

I also check this issue using cordova 7.1.0, cordova-ios 4.5.4 and cordova-plugin-file 6.0.1.
It looks working well for all 1000bytes, 200000bytes and 500000bytes text files.
If this issue occurs for iOS, could you please tell me the detailed steps to reproduce the
issue.


> Cordova Plugin File not reading large json files correctly - android
> --------------------------------------------------------------------
>
>                 Key: CB-14110
>                 URL: https://issues.apache.org/jira/browse/CB-14110
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: cordova-plugin-file
>    Affects Versions: 6.0.1
>         Environment: cordova version: 7.1.0
> cordova-android: 7.1.0
> cordova-ios: 7.1.0
>            Reporter: Joel Henry
>            Priority: Critical
>              Labels: android
>
> When reading a large json file (293kb), readAsText renders string incorrectly, adding
duplicate text after the file's text ends and breaking json structure. JSON.parse the text
fails due to this. It hangs and fails.
> {code:java}
> const root = `${this.window.cordova.file.applicationDirectory}www/assets/`;
> this.window.resolveLocalFileSystemURL(this.root + fileName,
> (fileEntry: FileEntry) => {
> fileEntry.file(file => {
> const reader = new (<any>this.window.cordova).FileReader();
> reader.onloadend = function () {
> console.log(JSON.parse(this.result));
> };
> reader.readAsText(file);
> });
> });
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


Mime
View raw message