apache / apache/cordova-plugin-file

Unable to open content from Dropbox

Open
#365 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
744
Forks
754
Avg merge
3d 4h
Merged PRs (30d)
1

Description

# Bug Report
When we try to open a file via an intent from the dropbox application (168.2.2) with the cordova plugin 6.0.1 it fails.

## Problem
The resolveLocalFileSystemURL fails when trying to retrieve the modofied date. this

### What is expected to happen?
We should be able to retrieve the file entry

### What does actually happen?
It fails.

## Information
the problem is that dropbox returns a string of the form
Weekday, Day Month Year Hour:MInutes:Seconds OffsetFrom GMT
Ex:
Mon, 21 Oct 2019 14:49:59 -05:00
which is not able to be parsed as a long.

### Command or Code
The method used is resolveLocalFileSystemURL, which eventually calls the function lastModifiedDateForCursor in contentFileSystem.java

if (columnIndex != -1) {
String dateStr = cursor.getString(columnIndex);
if (dateStr != null) {
return Long.parseLong(dateStr);
}
}

### Environment, Platform, Device
Android Pixel 2

### Version information
Cordova: 7.1
Cordova-plugin-file: 6.0.1
android platform: 6.4.0
Other Frameworks: AngularJS
Android : 10
Dropbox 168.2.2

## Checklist

- [x] I searched for existing GitHub issues
- [ ] I updated all Cordova tooling to most recent version
- [x] I included all the necessary information above

Contributor guide

Open the contributing guide

Research direction

Start in contentFileSystem.java at lastModifiedDateForCursor, reached through resolveLocalFileSystemURL. Reproduce the Android Pixel 2 scenario using a Dropbox file and inspect how its modified-date string is handled. Done means the file entry can be retrieved successfully when Dropbox returns the documented date format.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java, javascript
Domain
mobile-dev
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.