Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connecting to the Internet after opening the app for the first time doesn't trigger registration with Internet gateway #714

Closed
gnarea opened this issue Oct 16, 2023 · 3 comments · Fixed by #718
Labels
bug Something isn't working released

Comments

@gnarea
Copy link
Member

gnarea commented Oct 16, 2023

Describe the bug

If you're disconnected from the Internet when you open the gateway app for the first time, you'll get the screen saying that you're disconnected from the Internet (as expected). However, if you then connect to the Internet, the screen is updated to say that you're connected, but there's no attempt to actually register with the Internet gateway, so no Awala-compatible app can use the local gateway app.

How to reproduce

Steps to reproduce the behavior:

  1. Clear the Awala app data, or reinstall the app.
  2. Disconnect from the Internet.
  3. Open the Awala app and go through the onboarding screens.
  4. Observe the screen that says that you're disconnect from Awala.
  5. Connect to the Internet.
  6. Observe the screen that says that you're connected to Awala.
  7. Use Letro or Awala Ping. The Awala SDK will throw an exception because the Awala app isn't yet registered with its Internet gateway.

Expected behavior

The Awala app tries to register with the Internet gateway as soon as the connection with the Internet is established.

Additional context

Killing the Awala app after connecting to the Internet is a workaround.

@gnarea gnarea added the bug Something isn't working label Oct 16, 2023
@sdsantos
Copy link
Collaborator

@gnarea What approach you would prefer here?
a) Try to register periodically after the first failure (every minute for example)
b) Try to register on any ConnectionState change after the first failure
c) Combine a) and b), making sure that 2 registrations can't happen at the same time
d) Try to register if needed before starting the public sync, also making sure 2 registrations can't happen at the same time

@gnarea
Copy link
Member Author

gnarea commented Oct 26, 2023

I think it'd be ideal to attempt to register the first time that we succeed in pinging the Internet gateway -- basically, the same logic that governs the main screen and shows the "You're connected to Awala via the Internet" message. Is this option D?

Having said that, if that's too complicated, I'm open to other options.

@kodiakhq kodiakhq bot closed this as completed in #718 Nov 16, 2023
kodiakhq bot pushed a commit that referenced this issue Nov 16, 2023
Closes #714

Also fixes 2 issues I found:
- Certificates weren't deleted if expired, because that method was called after the never-ending public sync method
- The gateway certificate we received expires after 30 days, and we were always renewing them if the expiration date was less than 90 days (changed to 25 days)
Copy link

🎉 This issue has been resolved in version 1.8.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released
Projects
Development

Successfully merging a pull request may close this issue.

2 participants