• Black Instagram Icon

©2019 by Proctor Analytics

Singapore - Day 2

No use in complaining if you aren't going to do anything about it.

This is how I felt at 04:00

Thankfully Starbucks is open at 05:00, so a double espresso and some food later I'm feeling like myself again.

Yesterday I was starting to integrate AWS amplify user sign in / sign up into my SwiftUI based app. During the unit testing of a helper class designed to wrap the auth functions I re-learnt something. Don't forget to explicitly deal with asynchronous functions during unit testing, the standard way of calling functions and checking return values in the XCode unit testing framework will simply not allow one to wait for an asynchronous function to complete. The answer of course is to add some promises to the unit test function and close them only after the function to tested has returned its results (or returned an error).

User sign up workflow.

I have now created a simple screen to allow users to sign up and create an account. This is only part of the workflow however. Once the account has been created the user needs to enter a verification code to confirm ownership of the email address. Verification codes are being used to keep the signup process within the application. So I know need to store the user progress through the signup process so that if the app gets shut down before they have a chance to complete the process, we can let them carry on from wherever they left off.

Its probably trivial to mention, but I will anyway. Passwords entered at user signup are not stored in any capacity in a persisted state. Other than performing a check that the confirm password field has the same text as the password field the user' password is left alone.

I will store progress along the user sign up journey in userDefaults under the key 'signUpProgress'. The intention of this is to allow the correct screen to be displayed when we enter the sign up journey. If the key is not present, then we assume that either the user already has an account or they have not started the sign up process yet. There is an edge case where the user might delete the app and therefore the userDefaults before completing the signup journey. For this scenario I will have to build in a check if the user account is unverified in both sign up and sign in.

Meanwhile... the Rolls-Royce data pipeline requires some changes. Files coming into the pipeline are now in *.xlsx format as opposed to csv. Using the excellent openpyxl library for Python allows this code change to be quite quick to implement. By the end of the day I had it finished. Now I can look forward to figuring out the best way to make use of the data asset and how to control some of the more important elements of it.