Propagate errors that were silently swallowed - #18
Open
devin-ai-integration[bot] wants to merge 1 commit into
Open
Propagate errors that were silently swallowed#18devin-ai-integration[bot] wants to merge 1 commit into
devin-ai-integration[bot] wants to merge 1 commit into
Conversation
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
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.
Summary
Most error handling in Portreeve is already deliberate (structured
RegistryError/reclamation reasons,isMissingFileguards,Promise.allSettledsnapshots). This fixes the places where a failure genuinely disappeared — plus one case where the server could hang instead of reporting.Server shutdown could hang and lose its failure (
src/server/server.js).stop()setstopped = truebefore doing the work, so a failingunlink(socketPath)(EACCES, EPERM, …) meantstoppedPromisenever resolved,serveblocked forever, and the secondstop()inserveCommand'sfinallyreturned early. Shutdown is now memoized and its failure is recorded, logged as a diagnostic, and surfaced:serveCommandtherefore exits non-zero on a failed shutdown, and itsfinallyreports a shutdown failure on stderr instead of discarding it or masking the primary error.Failed upgrade rollback claimed success (
src/supervision/manager.js).install()swallowedsupervisor.stop(),uninstall(), andwaitUntilHealthy()rollback failures and always saidprior installation was restored, so a half-restored install looked like a clean rollback. Each rollback step is now attempted independently and its failure named in the thrown message:withPorthid lease abandon failures (packages/client/src/client.js).abandon(...).catch(() => {})meant a leaked lease was invisible. Now a non-collision startup failure whose abandon also fails throwslease_abandon_failedwith the startup error ascause, andbind_retry_exhaustedcarriescause: lastCollisionplusdetails.abandonFailures.PortreeveClientErroracceptscauseand passes it toError; documented indocs/client.md.Desktop background failures were dropped: polling/window
void coordinator.refresh(),void coordinator.checkForUpdates(), the update-manifestcatch {}, update-state cache read/write, and non-ENOENT renderer asset errors now go through a newreportBackgroundFailure(scope, error)(apps/desktop/main/diagnostics.js) rather than vanishing — the resulting UI states (unavailable, 404) are unchanged.Left alone deliberately: best-effort temp-file
unlinkinfinallyblocks,diagnostic-logtolerating a torn final line, andephemeral-ports/stack-documentfallbacks that are documented degradations.Testing
bun run check(typecheck, lint, format, tests) passes exceptrelease metadata > renders one checksum-pinned Homebrew formula for all targets, which also fails on unmodifiedmainin this environment. New tests cover the failed-shutdown propagation, the rollback-failure message, andlease_abandon_failed.Link to Devin session: https://app.devin.ai/sessions/00a2e05546fa4b8082b135c0e91d0d77
Requested by: @TrentBrown