Skip to content

Refine shared Effect idioms#3090

Draft
cursor[bot] wants to merge 2 commits into
mainfrom
cursor/idiomatic-effect-patterns-45d2
Draft

Refine shared Effect idioms#3090
cursor[bot] wants to merge 2 commits into
mainfrom
cursor/idiomatic-effect-patterns-45d2

Conversation

@cursor

@cursor cursor Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

What Changed

  • Replaced DPoP JWT header/payload ad-hoc JSON parsing and record validation with hoisted Effect Schema decoders using Schema.fromJsonString.
  • Reworked relay client install-lock retry/staleness handling to use Duration, DateTime.now, Schedule, and a tagged internal retry signal.
  • Added focused tests for schema-based DPoP payload rejection and stale install-lock recovery with TestClock.

Why

These changes keep shared runtime code closer to idiomatic Effect patterns: schema-backed parsing, testable Effect time, duration-based policies, and schedule-driven retries without real-time sleeps.

UI Changes

None.

Checklist

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

Note

Refine DPoP JWT validation and install lock acquisition to use Effect idioms

  • Replaces manual type guards in dpop.ts with schema-based decoders using Option types, so decoding failures now return specific errors ('Invalid DPoP JWT header.' or 'Invalid DPoP JWT payload.') instead of a generic 'Invalid DPoP proof.'.
  • Adds a private JWK material check in header decoding to explicitly reject headers containing private keys.
  • Replaces the manual retry loop in relayClient.ts with Effect.retry using a structured Schedule policy, and extracts stale lock detection into tryAcquireInstallLock using DateTime/Duration comparisons.
  • Behavioral Change: base64 or JSON decode errors in DPoP proof verification now surface as header/payload-specific errors rather than being caught by the generic catch-all.

Macroscope summarized e371cc2.

cursoragent and others added 2 commits June 15, 2026 16:13
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 Jun 15, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🚀 Expo continuous deployment is ready!

  • Project → t3-code
  • Platforms → android, ios
  • Scheme → t3code-preview
  🤖 Android 🍎 iOS
Fingerprint ae17d94b35f91f9c608a63dadbc3ddd9f4ba056e 313e506a7f15a9c3f15b01d787d68a12382432bf
Build Details Build Permalink
DetailsDistribution: INTERNAL
Build profile: preview:dev
Runtime version: ae17d94b35f91f9c608a63dadbc3ddd9f4ba056e
App version: 0.1.0
Git commit: f95a4457c7758fa6d92d3fe5f435f242bbe77bf3
Build Permalink
DetailsDistribution: INTERNAL
Build profile: preview:dev
Runtime version: 313e506a7f15a9c3f15b01d787d68a12382432bf
App version: 0.1.0
Git commit: f95a4457c7758fa6d92d3fe5f435f242bbe77bf3
Update Details Update Permalink
DetailsBranch: pr-3090
Runtime version: ae17d94b35f91f9c608a63dadbc3ddd9f4ba056e
Git commit: f95a4457c7758fa6d92d3fe5f435f242bbe77bf3
Update Permalink
DetailsBranch: pr-3090
Runtime version: 313e506a7f15a9c3f15b01d787d68a12382432bf
Git commit: f95a4457c7758fa6d92d3fe5f435f242bbe77bf3
Update QR

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