-
Notifications
You must be signed in to change notification settings - Fork 335
Switch to cordova-plugin-advanced-http for update downloads #513
Switch to cordova-plugin-advanced-http for update downloads #513
Conversation
- add build.json to pass additional flags to cordova - use build.json to pass `UseModernBuildSystem=0` avoiding build failure
Use XHR to pull remote file into sandbox
This is designed to follow #384, with deprecation of There's a bit of a mess with getting the branch back on track, please let me know if you'd like me to rebase or something of that sort. |
@microsoft @dlebu @alexandergoncharov is |
I've updated the first comment to reflect the current state of the PR. |
Thanks for this @ermik! Is this work ready to be merged into master? |
@jacobg I wish, but not yet. We're still waiting to know what exactly are the requirements for initiating the download — there are no documentation of CodePush API that I could find, particularly how the Is there anyone on CodePush team that can speak to how download is/was set up and executed so we can make sure nothing will go wrong with new code? |
this.currentFileTransfer.abort(); | ||
|
||
if (this.isDownloading) { | ||
this.isDownloading = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is questionable, but cordova-plugin-advanced-http
does not implement Canecelable
/ has no abort triggers I could track down.
Hi @ermik On the your question of the request headers: there are no requirements for explicit specifying headers. Could you please clarify your status on this PR and what can I do to help you? |
@ludufre I think you would help by checking out this branch running |
@alexandergoncharov I can't seem to be able to make |
|
@ermik Just to be clear: with But regardless of that, I'm trying to help with the |
Do what you think is best, but I wouldn't merge any PR's until tests can be run. /inv @Krasavinigor @matthiaswenz |
Yeah, your thoughts are really good! |
Working iOS and Android with defaults platform versions.
With I didn't find any code that I made that small change, here it is: https://github.com/ludufre/cordova-plugin-code-push/commit/159e18cfa9e2aa0c5c6d47ca7b3f0e1d2b1c9f1e (I new on this Github thing, so I don't know how to send this change to this Pull Request / Or @ermik can do this change himself) |
Another thing that I observed, perhaps it's default plugin behavior: If the Server Trust Mode is changed do 'pinned' ( Because this settings is global and not per HTTP request maybe can't be circumvented. We can add to README.md this behavior. What do you think? (In my case I have to add the appcenter.ms cert to www/certificates because I use SSL Pinning) |
@ludufre this is quite interesting, thank you for taking the time to poke around. @alexandergoncharov I'm afraid I know nothing about gulp. This doesn't seem like a gulp-related issue, but I've had trouble navigating the test suites from the very beginning of this PR. 😭 I'm gonna try but please don't get your hopes up. |
@alexandergoncharov @ermik @ludufre I started working on fixing tests here. |
Hi @ludufre , Unfortunately, I can't reproduce your issue with About Server Trust Mode: I think it is a good idea to add this info to docs. Could you please provide some code suggestions for this? |
I'm upgrading an app to use cordova-ios 6.1.0 and I'm having a compatibility issue with the file-transfer plugin. I'm using this fork until this PR is merged. |
I'm having the same issue as this user on iOS with this fork. |
Nevermind. I had cloned wrong PR. Fully working now
The issue #611 have FileTransfer in the logs. Are you sure it's related? This fork don't use it. |
Whether or not it's related - what's happening is that it updates successfully, and then it freezes on a white screen, and rolls back when I relaunch the application. I get the same critical log message:
EDIT: the last part of the stack trace is |
@szh, The unsafe FWIW |
@ermik here's the full trace:
I don't think file transfer is related to this error. It looks like the same as #611 to me... see my comment there too |
@szh Thanks! Please file your findings as an issue in this repo. It should be an easy fix whenever someone with decent Objective-C knowledge becomes available. |
Thank you very much! Why does |
This PR already published in new version: https://github.com/microsoft/cordova-plugin-code-push/releases/tag/v1.13.0 |
Should the version number be changed to 1.13.0? Anyway...it still freezes on a blank screen after [CodePush] Install succeeded. codePushSyncStatus 7 Main Thread Checker: UI API called on a background thread: -[WKWebView loadRequest:] [reports] Main Thread Checker: UI API called on a background thread: -[WKWebView loadRequest:] tcp_input [C4.1:3] flags=[R] seq=846688115, ack=0, win=0 state=LAST_ACK rcv_nxt=846688115, snd_una=2978486252 |
Sorry about missing |
WIP
Upd: July 15th, 2019 — this is back on the table for me; apologies for staleness.
Upd: November 21st, 2019 — resolved conflicts and fixed some mistakes.
Upd: April 16th, 2020 — @Krasavinigor jumped on to push this along.
Upd: June 24th, 2020 — I found the issue that was highlighted by Igor back in April, but haven't found a solution. I expect, now that's
cordova-ios@6.0
is out this will become a P1 on my radar, if somebody else doesn't resolve it sooner.Upd: July 27th, 2020 — #632 is tracking fixes to test suite which should be implemented before this major dependency change is merged in.
This PR follows through on the #384 by removing dependency on
FileTransfer
plugin which has been deprecated (apache/cordova-plugin-file-transfer@265b63f). It also implements fixes to the type checker errors highlighted during development.FileTransfer
— originally we went with XHRv2 which is cited as the migration strategy followingFileTransfer
deprecation, but it has raised issues with CORS (especially in a strict WKWebView networking environment on iOS). Native alternative iscordova-plugin-http
which has been superseded by-advanced-http
cordova-plugin-advanced-http
is written using common js and lacks typings. Additionally it writes to a non-standard cordova globalcordova.plugin.http
(plugin
-singular) and we have to amend the definition coming from@types/cordova
.This PR now also replaces regular request utility, since plain XHR in iOS 13 may be failing.