Make relay install lock use idiomatic Effect policies#2983
Draft
cursor[bot] wants to merge 9 commits into
Draft
Conversation
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>
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>
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>
Contributor
|
🚀 Expo continuous deployment is ready!
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Changed
Optioninstead of null-ish sentinels.Duration,DateTime, andSchedulefor stale-lock and retry policy logic.@effect/vitestassertstyle andLayer.mockfor the child process spawner.TestClock.Why
This keeps the relay install path closer to idiomatic Effect patterns and makes time-based lock behavior testable without relying on wall-clock time or ad-hoc millisecond arithmetic.
UI Changes
Not applicable; no UI changes.
Checklist
Verification
PATH="/home/ubuntu/.nvm/versions/node/v24.16.0/bin:$PATH" pnpm --dir packages/shared test src/relayClient.test.tsPATH="/home/ubuntu/.nvm/versions/node/v24.16.0/bin:$PATH" pnpm exec vp checkPATH="/home/ubuntu/.nvm/versions/node/v24.16.0/bin:$PATH" pnpm exec vp run typecheckNote
Add stale lock detection and Effect-idiomatic retry scheduling to relay install lock
acquireInstallLockwith a typedSchedulethat retries onRelayClientInstallLockBusyerrors and gives up withinstall_lockedafter exhausting attempts.isInstallLockStaleandattemptAcquireInstallLockhelpers that stat the lock file, compute its age usingDateTime.distance, and remove it if older thanINSTALL_LOCK_STALE_AGE(5 minutes) before retrying acquisition.INSTALL_LOCK_RETRY_DELAYandINSTALL_LOCK_STALE_AGEfrom raw numbers toDurationvalues, and internal option handling inresolveReleaseAssetandresolvePathExecutablefrom nullable returns toOption.'removes stale install locks before installing'that backdates a lock file to epoch, advancesTestClockby 6 minutes, and asserts the lock is cleared and install succeeds.Macroscope summarized a8c8572.