When CodePush App rollsback due to unknown reason, will it try to update again automatically? - code-push

I want to ask about a certain codepush scenario.
If my Codepush enabled react native App does a rollback while installing a new update due to unknown reason (failed install etc. ), then will it try to re-sync and try to install the latest codepush update again?
I looked in the Docs for this, but couldn't find anything solid and it is very difficult to re-produce this to test it manually.

Related

Expo React Native building apk

I have been trying to build my apk today but I always face this problem. After completing the build, i download it to my phone and i cannot open it. However, this was not the case 2-3 days ago. I had no difficulties or errors in Run expo doctor. I was able to download the apk to my device and test my app.
I am not really sure what to do and any help would be appreciated.
This is what I got after running npx expo doctor:
I managed to solve my problem. I used Android Studio's logcat feature and when I ran the app on the emulator I found the issue - it was related to admob. At this point, I dont need admob, so I deleted its folder from my project and everything was fine after this.
Running expo doctor usually ends up in flagging what dependency needs to be upgraded if the jump to automatically update it goes into the majors like in your case from 4 to 5.
Maybe try upgrading #expo/config-plugins by using expo upgrade or commands from your preferred package manager.
If that’s impossible due to other packages depending on the specific version, maybe consider adding overrides in your package.json. Here is a helpful article about that.
In my experience this may not be the only reason for the crash of the app. Try running the app consecutively about 3 or 4 times even if it crashes and I believe Android will prompt you to submit a bug report and maybe show you the call stack it failed at.
Let us know how it goes.

Why does CodePush OTA update nuke my fonts?

I've got codepush working for a staging build of an app I hope to soon have in production.
On initial download from the app store, the fonts are looking great! My version checking info that I have in the app shows me that I'm using the bundled version of the bundle.js
If I force-quit and re-launch the app (causing an update) the fonts are no longer found in the application. They display the "missing glyph" image (see screenshot below).
I'm hoping for either a solution, some tricks to try, or just some ideas about how to further debug and understand what is causing this. I'm a little stuck because when I try to run the app in debug mode, it just uses the latest codepush version instead of downloading a new one.

How to deploy codespush bundle on old targets when there are native changes on the new build

Before i continue, let me let you know that i know the code to deply to a targeted build for codepush
appcenter codepush release-react -a aountName/appName -d Production -m --description "CommentHere" -t versionName
I have tried to figure this out on my own and i have not been able to.
I have several versions of my app which i have deploy using CodePush and everything works well but I started having fears of crashes when i installed new packages on the latest build.
This implies the current code base would have new native differences as compaird to the old version.
The question is how can i deploy my new build with new native codes
and packages present to an old version of my app which does not have those
native packages without running into several crashes from all the users using the old version of the app...
I ask this cos i have a feeling if i push the new build with the new changes in UI and native chnages to the old version of my app, the app old app would crash.
If a bug comes in for an old version, how do I fix it and deploy it
for the old version only? Bugs may be critical and not everyone will
have the latest version of the app Or, the bug may only exist on a old
version of the app.
I await your response.
Code push will not affect any native code written within the Android or the iOS projects of a React-Native application. If you read the documentations carefully, it specifically says that it does not change / modify / update the native portion of the app.
Why?
This is because of the way the CodePush mechanism works. In essence, CodePush only stores and triggers the update of the JS bundle of the React-Native application.
This is why we wrap only the JS main app instance with CodePush HOC (Higher Order Component). This is what's happening when you do:
CodePush(MyApp); //wrapping the js bundle at app-root
So, unfortunately in your case, if there are native codes involved, regardless of deployment to a new or old version of the app, it has to be a AppStore / Playstore driven deployment.

Code-Push with CI/CD and native dependency changes

I am readying an app for release to the app stores and I'm concerned with CI/CD pipeline and Code-Push.
How does this scenario play out:
If a developer makes NPM dependency updates and there is a package updated that has native code changes that the JS relies on, will Code-Push still update the JS bundle on user devices ahead of their device downloading the native code updates?
Just so my question is clear, I'm not trying to OTA update native code - I'm referring to a situation where some package like react-native-device-info has native Java/Swift code and also has JS code that requires some api or event constant from the native code. If you bump the package version for react-native-device-info to a new release and there is changes to both native and JS code, would code-push have any way to know to not update the bundle until the native code/app was updated because the JS bundle has code that depends on the native code?
Or, am I thinking of using the tool Code-Push wrong?
The way codepush works is that it updates the JS bundle of your app. Your requirement is to update a NPM package which has a native change and update only your client side which is not possible.
If you do this you will probably end up with a crash of your app when the JS contacts the native code.
would code-push have any way to know to not update the bundle until the native code/app was updated because the JS bundle has code that depends on the native code?
Simple answer NO
Codepush is targeted on a version number so your new version which hits the stores will have a new version number so no point of updating the bundle of the old version of the app.
If you really want all your users to move to a new version push an alert or some sort of message using codepush asking the user to update.

Does react native enable live update without updating app?

I saw somewhere that you can update your code live in production with react-native (I can't remember where I saw it)
However, the javascript is bundled and packaged with the app, I don't think you can update javascript code without a new release.
Does react-native enable you to live update your js code in production or not?
Ya you can manage it with expo or you can use third party continuous deployment tools like code-push from Microsoft.
https://github.com/Microsoft/react-native-code-push
you can easily manage Staging and Production and environment.
you can roll out to some percentage.
can revert back.
all the js code can be updated but no native code.Otherwise you may face crashing issues.