Repository navigation
Conversation
`notarize` sets `const spinner = flags.json ? null : ora(...).start()` but then calls `spinner.succeed(...)` / `spinner.fail(...)` unconditionally (~20 sites), so `notarize <hash> -h <seed> -i <n> -j` throws `TypeError: Cannot read properties of null (reading 'succeed')` at the first call and never reaches the JSON output path. `spinner3` / `spinner4` were also always-on `ora` instances, so their progress text would have corrupted the JSON even if `spinner` were guarded. Add a `makeSpinner(text)` helper: a real `ora` spinner normally, a chainable no-op object under `--json`. All three spinners go through it. Non-`--json` behaviour is unchanged. Adds `notarize #8b`: `notarize ... -j` against an unreachable endpoint must exit non-0 without a `TypeError` in its output (fails before this change). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Collaborator
|
Thanks, this PR crosses with some fork work which closes this issue. Thank you for your contribution. |
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.
Problem
notarizestarts its spinner as:but then calls
spinner.succeed(...)/spinner.fail(...)unconditionallythroughout
run()(line 97spinner.succeed(...)is the first one on thehappy path). So any
--jsoninvocation dies immediately:The
-j/--jsonflag is documented ("Return JSON response") but hasnever worked.
spinner3andspinner4further down are always-onorainstances too, so their progress lines would have corrupted the JSON even
with
spinnerguarded.Fix
A small
makeSpinner(text)helper — a realoraspinner normally, achainable no-op object under
--json— used for all three spinners.Non-
--jsonoutput is byte-for-byte unchanged.Tests
notarize #8b:notarize ... -jagainst a deliberately unreachable grpcendpoint must exit non-0 without a
TypeErrorin its output. Fails onmaster(TypeError: Cannot read properties of null (reading 'succeed')),passes with this change.
npm run lintclean; existing non---jsonnotarize tests are unaffected (the helper returns the same
ora(...).start()).🤖 Generated with Claude Code