Skip to content

fix(connlib): Update search_domain for exsiting TunConfigs#8445

Merged
jamilbk merged 1 commit into
mainfrom
fix/always-apply-new-tun-config
Mar 15, 2025
Merged

fix(connlib): Update search_domain for exsiting TunConfigs#8445
jamilbk merged 1 commit into
mainfrom
fix/always-apply-new-tun-config

Conversation

@jamilbk

@jamilbk jamilbk commented Mar 15, 2025

Copy link
Copy Markdown
Member

For existing TunConfig, we had a bug where we failed to update the search_domain if the effective dns_servers were unchanged.

@thomaseizinger I can see why you want to refactor this; it's quite a mess to follow ;-). I was going to try my hand at cleaning it up a little bit just so I can grok it but I figured since this area is going to be changing quite a bit in #8263, I'll leave those changes out for now.

@jamilbk jamilbk requested a review from thomaseizinger March 15, 2025 15:46
@vercel

vercel Bot commented Mar 15, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
firezone ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 15, 2025 3:46pm

@jamilbk

jamilbk commented Mar 15, 2025

Copy link
Copy Markdown
Member Author

Tested manually; fixes the issue. Will merge in support of #8442

@jamilbk jamilbk merged commit 03b6e44 into main Mar 15, 2025
@jamilbk jamilbk deleted the fix/always-apply-new-tun-config branch March 15, 2025 23:12
existing.ip.v6 = config.ipv6;

// These are safe to always update
existing.search_domain = config.search_domain.clone();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure if this is enough, we probably also need to check in maybe_update_tun_config to actually push it to the host app? We should test this as well in the proptests.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You were right - update_dns_mapping is a no-op if the upstream resolvers don't change.

I tested manually extensively in #8452 which, although ugly, works robustly.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was very painful working through a few failed refactors to get to that PR 🙃. Lots of complexity I see what you mean.

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