Strange behaviour on create account & login on new runtime (not present on old)

Hello, I’m wondering if I missed a trick with the new runtime. I’m trying really hard to iron out all the kinks so I can abandon Legend forever but I am still having a couple of issues, not sure if this specific one is just me missing a new config.

Basically, I have a working create account & login flow which is working as expected in Legend but giving me a strange quirk in the new runtime. I’m using Xano backend, preview app on iOS on an iPhone 12, app ID is 149046.

Here’s what happens:

  • I land on the ‘login’ page (no auth required)
  • I switch to ‘create an account’ page (no auth required)
  • I add an email and password and click ‘sign up’
  • Xano is called and my user is created successfully
  • I am redirected back to the login page (tested both with ‘navigate back’ and ‘navigate to page’, no impact on issue)
  • I enter the email and password
  • I click login
  • A bunch of Xano endpoints are called, these all run successfully
  • For testing sake, I added an alert saying ‘process complete’ as the penultimate step in the flow, I see this
  • The final step in the flow is ‘Dismiss initial view’ (also tested with ‘navigate to page’, no impact on issue)
  • This appears to not work correctly because it just refreshes and leaves me on the login page

Then, if I stay in the preview app, ie. I do not leave and close the app:

  • If I enter the email and password again, the same behaviour is experienced, it refreshes the login page instead of closing initial view/redirecting to another page (the first page which requires authentication)

However, if I close the preview app and reopen it, and then try to log in, the final navigation function of the login flow does work and it redirects me to the landing page.

TLDR: if I create and account and then try to log in without exiting and returning I can’t, if I exit the app and return I can.

If I repeat all of this in the Legend preview app, it works as expected. This is not a huge issue for me since I guess at some point I’ll stick some kind of verification step in between create & login but just wondering if I missed something in the new runtime.

Hi! Sorry for the belated answer :grimacing: Are you still experiencing this? There are some changes to the internal navigation structure etc. which may be causing this, but I’d have to look into the matter more to know what’s going on, unless this would have been accidentally fixed between when you posted this and now :crossed_fingers:

To be honest I haven’t noticed it in a while so I think it’s okay!

1 Like

Ok, this has started happening again in my deployed app. I’m gonna do some further testing later, but here’s what appears to be happening since I implemented a persisted login scenario. This is happening for all my users on iOS, I haven’t got the Android build running yet.

  • If I am already logged in via persisted login and I click log out, I redirect back to the log in page. If I then try to log back in to any account, when I press log in, everything works and I am actually logged in, but ‘Dismiss Initial View’ doesn’t trigger, so I just sit on the login page. If I force close the app and re-open it, the persisted login triggers and I am logged in automatically.

  • If I log out and then create a new account, the create account flow works except for the last step where I redirect you to a ‘Thanks for registering’ type page (so in this instance ‘Navigate to Page’ is not triggering). If I log out, force close the app and re-open the app, then I create a new account, the navigate to page works.

  • If I am a completely new user, I open the app, I create an account and get to the ‘Thanks for registering page’, I click ‘Go to log in’, I see the log in page, I complete my newly registered credentials and press ‘Log in’, I will log in but again the dismiss initial view will not work and I’ll be stuck on this page until I force close and re-open the app.

It seems like something remains stored in my app which is wiped by the force reset which is preventing these navigate to page/dismiss initial views from working. However, it seems really odd to me because those steps do not have any conditions at all, so they should always be executed, regardless of what my variable and storage are up to. The most obvious and simple example is the Sign Up - if I log out of User Account A and sign up for User Account B, the flow is very simple:

Clicking logout:

Now, entering a new email + pw and clicking sign in:

And the strange part is, if I trigger an error on sign up (eg. I use a duplicate record, which is easy to trigger since the new record is created but the redirect fails) it does trigger the error. So I’m pretty convinced this is unique to navigation functions on new runtime.

Let me know if you need some more info or if there’s any obvious type of storage/variable I am not clearing that could be causing it.

Ok, now I just tested this again on Preview apps and it happens in the old runtime and the new runtime, so apologies for that, this could just be something I’m doing wrong with persisted logins actually.

What I just noticed was that when I hit login after logging out, the flow executes, the navigation bar appears, but the login page won’t disappear… except you can click something else from the nav bar and then you’re in and everything works.

Am I just completely missing something in the login flow, ie. is just deleting the user from storage and redirecting not enough?

OK NEVERMIND, I found the issue(s). I switched my navigate to login page to ‘return to initial view’ from the market, my bad as I didn’t realise that function existed. Then I realised I had a bunch of my initial view pages set to open in modals. Once I turned that off they all started working just fine.

For references, here were my test cases, all now pass on iOS & Android via the Preview app.

Log in
Log out
Log back in

Log in
Log out
Create new account
Log in to new account

Log out
Force quit everything (imitate brand new user)
Create new account
Log in to new account
Log out of account
Log back in to account