Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
relays: automatically load extra regional bootstrap relays
Depending on user's locale. currently only supported for Japanese users. This change allows Japanese users to automatically connect with popular Japanese regional relays during account creation, thus allowing Japanese users to better connect with the Japanese Nostr community. More specifically, 3 Japanese regional relays will be automatically added to the user's relay list (on top of the usual relays) under the following conditions: 1. User's region (As configured in iOS settings) is Japan, AND 2. The user is creating a new Nostr account through Damus. In the case the Nostr account is not new, Damus will not add any regional relays (It will respect the user's relay list). Testing ------- PASS Device: iPhone 15 Pro (Simulator) iOS: 17.0.1 Damus: This commit Test steps: 1. With the US region set, install Damus 2. Go through onboarding and create a new account. 3. Once the onboarding is complete, look at the connected relays. Should only be connected with popular international relays. PASS 4. Uninstall Damus 5. On iOS settings, go to Location & Region settings and change the region to Japan. 6. Install Damus 7. Go through onboarding and create a new account. 8. Once the onboarding is complete, look at the connected relays. User should be connected with intl relays as well as Japanese relays. PASS 9. Quit Damus and restart 10. Ensure the Japanese relays are still on the list. PASS 11. Quit Damus 12. Change region back to US 13. Restart Damus and check the relay list. Relay list should not be affected. PASS 14. Reinstall Damus 15. Check relay list. Only intl relays should be shown. PASS 16. Change region to Japan (JP) 17. Restart Damus and check the relay list. Relay list should not be affected. PASS 18. Reinstall Damus 19. This time, login with a pre-existing account (One that is not connected to Japanese relays). 20. After onboarding, check relay list. The relay list should be unaffected (i.e. Japanese relays should not have been added since this account is pre-existing). PASS Note: The actual network connection with some of the Japanese relays failed, but that is likely due to the Geo-based IP restrictions imposed by some of those Japanese relays. The relay list has been copied verbatim from @mattn's suggestions. Reference ticket: #1447 Changelog-Changed: Automatically load extra regional Japanese relays during account creation if user's region is set to Japan. Signed-off-by: Daniel D’Aquino <[email protected]> Signed-off-by: William Casarin <[email protected]>
- Loading branch information