Update not downloading, stuck on Reporting binary update (1.0.0)
Steps to Reproduce
- Build iOS application in Release mode
- Add
codePush.sync()tocomponentDidMountof home screen - Change code locally and run
appcenter codepush release-react -d develop -m, ensuring current appcenter app is the one I am testing and the deployment keys match. - Restart app and expect new bundle to be downloaded and installed.
Expected Behaviour
I would expect the latest bundle to be downloaded
Actual Behaviour
The codePush.sync() method is being called correctly.
I have logged out the POST request being made by request-fetch-adapter.js and it has all of the appropriate information required.
However, nothing seems to happen inside of the try/catch block.
It seems like the POST request is silently failing or not being handled.
Is there some sort of setting I need to enable to tell iOS it is okay to make this request?
I get the following log output from my device in the console, there are only a few entries related to CodePush:
2020-06-22 07:58:59.784736-0700 AppName[457:45853]
[CodePush] Loading JS bundle from file:///private/var/containers/Bundle/Application/28BD6FC6-C42B-4C52-B3B8-E2FE4CC646DD/AppName.app/main.jsbundle
2020-06-22 07:59:00.278 [info][tid:com.facebook.react.JavaScript] [CodePush] Sync already in progress.
2020-06-22 07:59:00.282 [info][tid:com.facebook.react.JavaScript] [CodePush] Checking for update.
2020-06-22 07:59:00.289 [info][tid:com.facebook.react.JavaScript] [CodePush] Reporting binary update (1.0.0)
No further log output is seen after this and the update is not installed.

I have also manually edited the request-fetch-adapter with the following logs:
async request(verb, url, requestBody, callback) {
if (typeof requestBody === "function") {
callback = requestBody;
requestBody = null;
}
const headers = {
"Accept": "application/json",
"Content-Type": "application/json",
"X-CodePush-Plugin-Name": packageJson.name,
"X-CodePush-Plugin-Version": packageJson.version,
"X-CodePush-SDK-Version": packageJson.dependencies["code-push"]
};
if (requestBody && typeof requestBody === "object") {
requestBody = JSON.stringify(requestBody);
}
console.log('requesting', requestBody, headers)
try {
const response = await fetch(url, {
method: getHttpMethodName(verb),
headers: headers,
body: requestBody
});
console.log('response', response)
const statusCode = response.status;
const body = await response.text();
callback(null, { statusCode, body });
} catch (err) {
console.log('err callback', err)
callback(err);
}
}
Neither the response, or err callback console logs are ever hit, which I find incredibly odd..
Reproducible Demo
- Download https://github.com/Microsoft/react-native-code-push/archive/master.zip and unzip. From
Examplesfolder runnode create-app.js appName [email protected] [email protected]command to generate plain CodePushified React Native app. Please see description on top ofcreate-app.jsfile content if needed - If you can't reproduce the bug on it, provide us as much info as possible about your project
Will try and get this up and running, will edit accordingly.
Environment
- react-native-code-push version: 6.2.1
- react-native version: 0.62.2
- iOS/Android/Windows version: iOS 13.2
- Does this reproduce on a debug build or release build? Release
- Does this reproduce on a simulator, or only on a physical device? Physical device (iPhone 7)
Hopefully you might have a clue what is going on and maybe I am missing something. Many thanks for any help you can give.
Hi @kanso-michael , Thanks for reporting!
Could you please try to wrap your main component in CodePush wrapper. Here are examples: https://github.com/microsoft/react-native-code-push#plugin-usage Also, if it was not helpful could you please provide some demo app with reproducing issue and reprosteps? I would like to reproduce and investigate it.
Thanks for the quick reply, unfortunately i've tried:
const screen = codePush(WelcomeScreen)
export { screen as WelcomeScreen }
and
const codePushOptions = {
checkFrequency: codePush.CheckFrequency.ON_APP_RESUME,
}
const screen = codePush(codePushOptions)(WelcomeScreen)
export { screen as WelcomeScreen }
On starting the app I see:
2020-06-23 02:40:34.692 [info][tid:com.facebook.react.JavaScript] [CodePush] Checking for update.
However there is no further log output.
I have tried minimising and maximising the app and only see
2020-06-23 02:38:05.941 [info][tid:com.facebook.react.JavaScript] [CodePush] Sync already in progress.
It seems to be getting stuck somehow, but can't seem to work out why. I can work on getting a demo built after work.
I am using React Native Navigation, if it could be affecting it?
Thanks again for any help
I am using React Native Navigation, if it could be affecting it?
It is a good question. I'm not sure for now.
Yeah, the demo app will be really useful to reproduce and investigate. I will be waiting for it. Thanks!
Hey @alexandergoncharov seems the problem was with our project, a misconfigured babel config was completely breaking fetch!
Have resolved that issue now and seems to be checking for updates okay now.
Thanks for your help anyway.
Hi @kanso-michael ,
That's cool! Thanks for letting us know about it.
I'm going to close this issue for now as It was resolved. Please feel free to reopen it if you have any questions.