Repository navigation
fix: six silent-failure bugs found in a repo audit - #152
Merged
Merged
Conversation
- retention: a previousVersion naming an uninstalled version (an upgrade
interrupted before its state write) unprotects the installed fallback;
fall back to the newest installed version
- zip: an entry with an empty symlink target passed every safety check and
failed the whole extraction at symlink(''); disclose and skip it
- connect: revoked-but-unlinked reported 'signin' instead of 'off'
- sign-in: a session that never printed its URL was never killed or
settled by the TTL; rescue every non-terminal state like the siblings
- manager: guard the failure-record write so a full state volume cannot
replace the operation's own error
- t3-pair/t3-expose: keep a failed pipeline from aborting under set -e
before the script's own error handling runs
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.
A full-repo audit turned up a set of small bugs with one thing in common: they fail silently. This fixes six of them — each a one-to-four-line change, each with a regression test that fails on
main.What was wrong
previousVersionnaming a version that is no longer installed. No installed version matched it, so the "Previous version" protection attached to nothing, and the next automatic retention pass could remove the only remaining older version.awaiting-*states, so a CLI stuck instarting(no network, nothing printed) was never killed and never settled. Both sibling starters already use the!TERMINAL_STATEScondition; this one now does too.fs.symlink('')threw a rawENOENTafter the other entries had already been staged.t3-pair's error path was dead code. Underset -euo pipefail, a failed mint aborted the script before its own error handling — with stderr already discarded — so a failed pairing printed nothing at all.t3-exposehad the same shape: one refused connection during its 40-second poll (the setup server restarts on its own 5-second loop) killed the CLI mid-"Publishing…".revokedwon over "not wanted", so an unlinked server whose relay link was later revoked showedsignininstead ofoff.runLockedwas unguarded; if it threw, it replaced the original error, skipped the post-op cleanup, and left the row reading as "interrupted".Validation
connect,connect-api,harness-retention,harness-manager,files-archives— 162/162.node --test tests/*.test.mjs): 2030/2031 pass. The one failure is a temp-dir cleanup race under parallel load (ENOTEMPTYon~/.npm/_logswhile a child npm still writes into the temp home duringt.after); it passes 3/3 in isolation and does not touch any file in this diff.mainhas the same class of parallel-load flake inconnect-api.test.mjs's revocation assertion.bash tests/t3-pair.test.shpasses; CI's lint job now runs it (one line inbuild.yml), and it is covered by the existingbash -n+ shellcheck globs.Per-fix details and known gaps
previousVersionfalls back to the newest installed versiondocker/harness/retention.mjstests/harness-retention.test.mjsdocker/setup/files/zip-format.mjstests/files-archives.test.mjsrevokedno longer overrides "not asked for"docker/setup/connect.mjstests/connect.test.mjsdocker/harness/manager.mjstests/harness-manager.test.mjsdocker/bin/t3-pairtests/t3-pair.test.sh(new, wired into CI lint)docker/bin/t3-exposedocker/setup/server.mjsKnown gaps, stated plainly:
SESSION_TTL_MSis 15 minutes, so covering it means refactoring the timer for injection. The change copies the identical, already-tested condition from the two sibling starters (startScmDeviceSignin,startConnectLink).t3-exposepoll change is inspection-only: exercising it needs a stub setup server that fails once then answers, which the current.test.shharness doesn't have.chown -Rcrossing nested read-only mounts) need their own PRs with heavier test harnesses.