Hi all,
last week I attended the aquaculture conference in Italy, Rimini and saw a lot of parallels to beekeeping, but they make more effort in topics like sustainable, environmental friendly and fish wellbeing, which I really liked. As vegetarian I think we should not farm fish anyway, but yeah aquaculture does also include stuff like algae farming. Of course the most interesting for me where the applied computer science and robotics talks.
Nevertheless, yesterday was a long day for me, the live migration to my new application version was happening. As this is my third ābigā migration I already knew how to prepare myself.
This were my steps, which helped me a lot:
- notify users inside the old app about the time of migration (~1 month before)
- create a list in order you need to do for migration, eg. set old app into maintenance mode, reload live server with all new packages, create DNS and redirects ā¦
- health tips: yoga in the morning and prepare lunch the day before migration
- backup backup backup and be ready to reroll in case of failure
Overall everything worked as expected, the database after migration needed again a ārepairā/āoptimisationā but I was already prepared for it:
mysqlcheck -u -p -h -P --auto-repair --optimize --all-databases --verbose
Had some docker container starting failures due to missing env entry. Which did me cost some nerve to find but was ok after a few minutes of sweating.
After the service went online again and DNS was already changed, a user reported he could not log into the app. This was quite frustrating as I could not figure out why, but lastly the user itself gave the hint.
In the new version I clean the emails with normalizeEmail
from express-validator
. I did not know but gmail addresses with points eg. max.muster@gmail.com
will be normalised to maxmuster@gmail.com
. Of course after normalisation the new email is not the same as the registered email because in my old app I did not normalise it. Therefore, the user could not log into the app and could not reset his password. Therefore a quick decision was made to not normalise emails at all (the same as in the old app), this may cause pain in the future if one user mixes up upper case or lower case.
Next pain were the AppStore and PlayStore apps, I would love to drop them completely but lots of people want it and simply donāt know how to install PWA. Android was quickly archived and everything works more or less. iOS was a lot more pain, also because I really have zero experience with XCode and swift programming language. In addition iOS does not really like the kind of wrapper apps and donāt support PWAs. One main thing what did break the iOS app was printing, I solved it by disabling it. Not the best approach but yeah. Maybe someone here is more into swift programming? Currently the code looks like this:
// redirect new tabs to main webview
func webView(_ webView: WKWebView, createWebViewWith configuration: WKWebViewConfiguration, for navigationAction: WKNavigationAction, windowFeatures: WKWindowFeatures) -> WKWebView? {
if (navigationAction.targetFrame == nil) {
let app = UIApplication.shared;
if(navigationAction.request.url?.absoluteString != ""){
let url = navigationAction.request.url!;
if !app.canOpenURL(url){
webView.load(navigationAction.request)
}
} else {
// Notify user that printing is not allowed (blank new window, without url)
self.notif()
}
}
return nil
}
Another problem caused the Stripe payment which I know solved by redirecting to the external browser, which is not the best but was my only viable solution:
if(requestUrl.absoluteString.contains("stripe")){
UIApplication.shared.open(requestUrl)
decisionHandler(.cancel)
} else {
decisionHandler(.allow)
}
Today after the big migration was more relaxing finishing new demo images for Play and App Store and cleaning some junk codes.
Cheers
Hannes