WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Conversation

@ThatOneShortGuy
Copy link
Contributor

A fix for #1000

As someone who has never written Go before, that was pretty straight forward

@schollz
Copy link
Owner

schollz commented Nov 18, 2025

@ThatOneShortGuy the reason they were taken out is because its annoying when the default server relay changes and the config files have to be redone (because it stores the old), so my one ask would be to fix this so that the remember relay option only works if the relay address is different than the default

@ThatOneShortGuy ThatOneShortGuy force-pushed the issue1000 branch 2 times, most recently from 6ff6cbf to f013040 Compare November 18, 2025 03:52
don't save relay if it is the default

don't use remembered relay if it is the default
@ThatOneShortGuy
Copy link
Contributor Author

@schollz I see what you're talking about. At this point my concern is when the default IP changes. We can't track that in code, and the existing configs already have something like "RelayAddress": "46.62.254.13:9009".

The best solution to that I can think of is to add the default models.DEFAULT_RELAY{6} to the list of addresses to try ([]string{c.Options.RelayAddress6, c.Options.RelayAddress}). I didn't add that in this PR yet, wanted to get your opinion first.

@schollz
Copy link
Owner

schollz commented Nov 18, 2025

Maybe something like saving the default address as a special symbol "default" or something.

That way when it loads it always knows to use the default (even if it has changed).

@ThatOneShortGuy
Copy link
Contributor Author

I added the "default" if the saved relay is the same as the relay. However, this gave me the idea to make the saved relays work correctly by having a prefixed token "non-default:". This way, it will only work on relays user have saved after updating to maintain backwards compatibility.

@schollz
Copy link
Owner

schollz commented Nov 19, 2025

Awesome, looks good!

@schollz schollz merged commit 9ddb65d into schollz:main Nov 19, 2025
@ThatOneShortGuy ThatOneShortGuy deleted the issue1000 branch November 19, 2025 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants