Skip to content

fix(network): conform DNS resolver to aiohttp ResolveResult typing - #5

Merged
ajram23 merged 1 commit into
mainfrom
fix/resolver-resolveresult-conformance
Jun 3, 2026
Merged

fix(network): conform DNS resolver to aiohttp ResolveResult typing#5
ajram23 merged 1 commit into
mainfrom
fix/resolver-resolveresult-conformance

Conversation

@ajram23

@ajram23 ajram23 commented Jun 3, 2026

Copy link
Copy Markdown
Owner

Finishes the Copilot-review cleanup of the ported resolver code (same bbb2f27 wiring). _PinnedResolver.resolve returned list[dict[str, Any]] but aiohttp's AbstractResolver.resolve requires List[ResolveResult]; _resolve_host's dedup key was tuple[str | int, AddressFamily] vs its set[tuple[str, int]]. Now imports AbstractResolver/ResolveResult from aiohttp.abc, types the record flow as ResolveResult, and coerces sockaddr[0] to str. pyright: 0 errors; behavior unchanged; 2297 tests pass (incl. private-range/rebinding).

The remaining Copilot-review-adjacent items in the resolver, all from the
original wiring: `_PinnedResolver.resolve` returned `list[dict[str, Any]]`
where aiohttp's `AbstractResolver.resolve` requires `List[ResolveResult]`,
and `_resolve_host` built a `tuple[str | int, AddressFamily]` dedup key that
didn't match its `set[tuple[str, int]]`.

- Import `AbstractResolver`/`ResolveResult` from `aiohttp.abc` and subclass
  `AbstractResolver` directly (clears the `aiohttp.abc` attribute-access
  warning and lets pyright actually check the override).
- Type `_resolve_host`, `check_allowed`, and `_PinnedResolver` records/return
  as `ResolveResult` (the record dicts already carry exactly its keys).
- Coerce `sockaddr[0]` to `str` so the dedup key is `tuple[str, AddressFamily]`.

pyright: 0 errors/0 warnings on the module. Behavior unchanged; 2297 tests
pass incl. all private-range/rebinding tests.
@ajram23
ajram23 merged commit 4dee9a0 into main Jun 3, 2026
3 checks passed
ajram23 pushed a commit that referenced this pull request Aug 11, 2026
Wire NetworkConfig through Bash + curl + interpreter (closes #5)
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.

1 participant