Skip to content

Use more idiomatic Effect helpers#2791

Draft
cursor[bot] wants to merge 3 commits into
mainfrom
cursor/effect-codebase-idioms-46bd
Draft

Use more idiomatic Effect helpers#2791
cursor[bot] wants to merge 3 commits into
mainfrom
cursor/effect-codebase-idioms-46bd

Conversation

@cursor
Copy link
Copy Markdown
Contributor

@cursor cursor Bot commented May 23, 2026

What Changed

  • Updated the Tailscale package to use Option for optional MagicDNS values, Duration constants for timeouts, and Schema.TaggedErrorClass for Tailscale errors.
  • Updated Tailscale consumers/tests for the new Option shape and used Layer.mock for partial process service mocks.
  • Replaced Windows process diagnostics JSON parsing with Schema.fromJsonString decoding and used a Duration timeout constant.

Why

These are small, focused Effect idiom improvements that make optional data, durations, serializable errors, service mocking, and JSON decoding more explicit and testable.

UI Changes

Not applicable.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes
Open in Web View Automation 

Note

Replace null checks with Option and numeric timeouts with Duration across Tailscale and process utilities

  • TailscaleStatus.magicDnsName, parseTailscaleMagicDnsName, and resolveTailscaleHttpsBaseUrl now return Option.Option<string> instead of string | null; callers use Option.some/Option.none throughout.
  • Timeout constants in tailscale.ts and ProcessDiagnostics.ts are replaced with Duration-based values; observed durations are unchanged.
  • Error classes (TailscaleCommandError, TailscaleStatusParseError, TailscaleUnavailableError) are migrated from Data.TaggedError to Schema.TaggedErrorClass.
  • Windows process decoding in ProcessDiagnostics.ts is refactored to use Schema-based parsing with decodeUnknownOption, replacing a manual JSON.parse try/catch.
  • Tests are updated to use Layer.mock for spawner mocks and Option-aware assertions.
  • Behavioral Change: any code consuming magicDnsName, parseTailscaleMagicDnsName, or resolveTailscaleHttpsBaseUrl must now handle Option instead of nullable strings.

Macroscope summarized bc3c829.

cursoragent and others added 3 commits May 23, 2026 16:06
Co-authored-by: Julius Marminge <juliusmarminge@users.noreply.github.com>
Co-authored-by: Julius Marminge <juliusmarminge@users.noreply.github.com>
Co-authored-by: Julius Marminge <juliusmarminge@users.noreply.github.com>
@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels May 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant