Closed blefebvre closed 6 years ago
@blefebvre can you try this branch to see if it fixes your problem?
https://github.com/phonegap/phonegap-plugin-contentsync/pull/169
@blefebvre this might be a duplicate of #166
@macdonst looks to me like the code in #169 is already in master (68b70d).
I should have mentioned that on run 3 (and beyond) of the app, this issue does not occur since the previousVersion
has been set at this point (via hasAppBeenUpdated()
), so the comparison works as expected:
2017-11-09 16:53:46.663171-0500 helloworld[11217:617981] previous version 1.0.5
2017-11-09 16:53:46.663258-0500 helloworld[11217:617981] current version 1.0.5
Fixed in 1.4.1
Expected Behaviour
The copyRootApp operation should not overwrite any content in the sync'd directory on subsequent runs of the app, assuming the app's version has not increased.
Actual Behaviour
On the second run of an app that calls
.sync()
withcopyRootApp: true
set on startup, the copyRootApp operation will be performed again unnecessarily, effectively overwriting any changes that were made in the sync'd directory during the first run of the app.Reproduce Scenario (including but not limited to)
This issue can be reproduced with this basic app repository: https://github.com/blefebvre/phonegap-plugin-contentsync-bugs
It has been reproduced successfully on iOS 11.1, 10.3, and 10.2.
Steps to Reproduce
phonegap prepare ios
open platforms/ios/helloworld.xcworkspace/
Platform and Version (eg. Android 5.0 or iOS 9.2.1)
Tested on iOS 11.1, 10.3, and 10.2. Not an issue on Android.
(Android) What device vendor (e.g. Samsung, HTC, Sony...)
n/a
Cordova CLI version and cordova platform version
Plugin version
Sample Code that illustrates the problem
https://github.com/blefebvre/phonegap-plugin-contentsync-bugs
Logs taken while reproducing problem
Included above.