Open elijahr opened 4 years ago
@elijahr i think that your issue is related to this --> https://github.com/microsoft/cordova-plugin-code-push/pull/608
Hi @elijahr! Thank you for reporting! We reproduced this issue. We will investigate it as soon as possible.
Description
fileUtil references
cordova.file.dataDirectory
in several places. According to cordova's docs,cordova.file.dataDirectory
is available ifiosExtraFilesystems
includeslibrary-nosync
. The default value foriosExtraFilesystems
includeslibrary-nosync
, so for many users, there is no issue.However, if a developer's
config.xml
explicitly specifies aniosExtraFilesystems
which does not includelibrary-nosync
, codePush will behave in unexpected ways. From what I was seeing, one of several things could happen, inconsistently:notifyApplicationReady()
having been called on each app start.I suspect that this is because when
library-nosync
is not specified, the corresponding directoryLibrary/NoCloud/
is still created byFileUtil.getDirectory()
, but is synchronized to iCloud, since it is a subdirectory ofLibrary/
. It's not clear to me why this makes a difference, but it may have to do with a user's available iCloud storage space (I am maxed out on storage at the moment, but this issue was affecting most of our end users). It may be something else; the behavior of reading/writing data inLibrary/NoCloud
withoutlibrary-nosync
is unspecified.Adding
library-nosync
toiosExtraFilesystems
fixed codePush for me; the updates consistently finished installing and "stuck". I couldn't find any documentation on this requirement, though I did find this unresolved issue that seemed possibly related.Given that fileUtil references
cordova.file.dataDirectory
, andcordova.file.dataDirectory
is only configured correctly iflibrary-nosync
is specified, at the very least this requirement should be documented somewhere. More ideally, the build should fail ifiosExtraFilesystems
does not containlibrary-nosync
, a more helpful error message should be shown, or the plugin should simply override/append thelibrary-nosync
value toiosExtraFileSystems
if it is not present.Reproduction
Create a cordova application with the following additional configuration:
And observe that updates do not consistently install or "stick".
Additional Information