Skip to content

Handle unsupported AliasMode records - #9656

Merged
swankjesse merged 1 commit into
mainfrom
jwilson.0812.alias_mode
Aug 12, 2026
Merged

Handle unsupported AliasMode records#9656
swankjesse merged 1 commit into
mainfrom
jwilson.0812.alias_mode

Conversation

@swankjesse

Copy link
Copy Markdown
Collaborator

No description provided.

val queries =
questions.map { question ->
val questionToQuery =
questions.associateWith { question ->

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

TIL The returned map preserves the entry iteration order of the original array.


TYPE_A, TYPE_AAAA -> {
resourceRecords.mapNotNull { resourceRecord ->
// Discard resource records that don't fit the query.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

this seems unlikely and worth warning about, but I assume we think it won't happen, so ignore?

Arguably ew should throw away A answers for a AAAA query, but I'm guessing this is a smart cast.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Yeah even if we did warn, it's unlikely the recipient of the warning would be able to do something with it.

if (resourceRecord !is ResourceRecord.Https) return@mapNotNull null

// OkHttp doesn't yet implement AliasMode resource records. If any AliasMode record is
// returned, we must ignore ALL returned resource records.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

TODO log something observable?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I don't think the recipient of the warning is the person who can do anything about it.

There's probably a DNS record linter tool for DNS admins to learn that their records are malformed.

@swankjesse
swankjesse merged commit 97fc958 into main Aug 12, 2026
40 of 44 checks passed
@swankjesse
swankjesse deleted the jwilson.0812.alias_mode branch August 12, 2026 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants