relaycorp / relaynet-gateway-android

Awala Gateway for Android
https://relaynet.network/users
GNU General Public License v3.0
9 stars 0 forks source link

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

Closed gnarea closed 12 months ago

gnarea commented 1 year ago

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.

sdsantos commented 1 year ago

@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 commented 1 year ago

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.

github-actions[bot] commented 12 months ago

:tada: This issue has been resolved in version 1.8.2 :tada:

The release is available on:

Your semantic-release bot :package::rocket: