Skip to content

feat(tracer): independent trace cancellation and per-operation hop options - #79

Merged
dweekly merged 4 commits into
mainfrom
feat/trace-options-and-cancellation
Sep 4, 2026
Merged

feat(tracer): independent trace cancellation and per-operation hop options#79
dweekly merged 4 commits into
mainfrom
feat/trace-options-and-cancellation

Conversation

@dweekly

@dweekly dweekly commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Summary

Implements the first phase of the Cache and Network-Transition Lifecycle proposal from docs/CACHE-AND-TRANSITION-LIFECYCLE.md:

  • cancelActiveTraces(): Decouples active trace cancellation from cache invalidation. Snapshots and cancels in-flight trace handles while preserving cached rDNS, public IP, and ASN data. Traces registered after cancellation begins remain tracked for subsequent operations.
  • TraceOptions: Additive per-operation configuration struct providing maxHops override (validated against 1...255), available via trace(to:options:) and traceClassified(to:vpnContext:resolver:options:).
  • Source and binary compatibility: Retains exact existing trace(to:) and traceClassified(to:vpnContext:resolver:) entry points so downstream callers and DocC symbol links remain fully backward compatible.
  • Conservative composition: networkChanged() delegates directly to cancelActiveTraces() while preserving its full cache invalidation contract.

Testing

  • Added TraceLifecycleTests covering:
    • cancelActiveTraces() cancelling active traces without wiping rDNS or cached public IP, and confirming networkChanged() still clears both.
    • TraceOptions maxHops bounding trace hops.
    • TraceOptions out-of-range validation throwing TracerouteError.invalidConfiguration.
  • Ran full test suite (all 325 tests passing).
  • Validated DocC builds warning-clean with --warnings-as-errors.
  • Validated swift format lint --strict.

@dweekly
dweekly merged commit 1b5d6e2 into main Sep 4, 2026
7 checks passed
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