apache / apache/cordova-plugin-file

File Path Issue in iOS 13.1

Open
#346 31 comments 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

## Problem: Local file path returns incorrectly on iOS 13.1

### What is expected to happen?

`cordova.file.applicationDirectory` returns a file path which is supported by `resolveLocalFileSystemURL` to parse out a local path path for use in a cordova app.

### What does actually happen?

`cordova.file.applicationDirectory` now returns a file path prefixed with `/private/` which is incorrectly parsed by `resolveLocalFileSystemURL` to produce an incorrect file path for use in a cordova app.

## Information

This issue exists is the iOS 13.1 beta, which is due to release at the end of September. Being this early in a beta, it's difficult to determine whether iOS is broken, or the plugin is broken, but to be proactive I am assuming the latter.

I've dug through the 13.1 release notes, and don't see anything jumping out at me that'd modify the local file storage directory paths. With recent changes to the HTML5 app guidelines over the Summer, I figure this could be a rogue change of sorts to modify how apps are being sandboxed/given access to the file system.

Testing to reproduce this, I was building my iOS app to two physical iPhone XR's, one on iOS 13 Gold Master, and one on iOS 13.1 Beta 3 and comparing file paths returned by the plugin.

### Command or Code

`cordova.file.applicationDirectory`
`window.resolveLocalFileSystemURL`

### Environment, Platform, Device

iPhone XR iOS 13.1 Beta 3

### Version information

cordova-plugin-file 6.0.2

## Checklist

- [x] I searched for existing GitHub issues
- [x] 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 by reproducing the behavior on an iPhone XR running iOS 13.1 Beta 3, comparing cordova.file.applicationDirectory with window.resolveLocalFileSystemURL. Trace how the /private/ prefix is handled and verify the resulting local path against the iOS 13 Gold Master behavior. Done means the application directory resolves to a usable local path without incorrect prefix handling.

Written by the indexing model from the issue text.

Assessment

Tech stack
ios, javascript, objective-c
Domain
mobile-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.