Skip to content

th-9c3f4e: retry the notarization wait, not the submission - #607

Merged
brentrager merged 1 commit into
mainfrom
th-9c3f4e-notary-retry
Sep 17, 2026
Merged

brentrager merged 1 commit into
mainfrom
th-9c3f4e-notary-retry

Conversation

@brentrager

Copy link
Copy Markdown
Contributor

What happened

The first SmoothFlow 0.2.3 publish (run 35261785786) failed ~16 minutes in, after a successful upload:

Submission ID received
  id: d0dc4559-bfdd-49e7-9afd-65d15b0f3bdd
Successfully uploaded file
Waiting for processing to complete.
Current status: In Progress.....Error: HTTPError(statusCode: nil,
  NSURLErrorDomain Code=-1001 "The request timed out."
  …/notary/v2/submissions/d0dc4559-…

Apple accepted the upload and was processing it. A status GET timed out, and because the script used notarytool submit --wait — which collapses "upload" and "poll until finished" into a single call — that transient failure took down the whole step. Twenty minutes of signed build discarded, with a perfectly valid submission id sitting in the log.

Not a logic error in th-9c3f4e, but that change made it twice as likely to bite: stapling the app and the DMG means two notarization round-trips per release instead of one.

The fix

Split submit from wait, so the retry targets the right thing:

  • submit once, capture the submission id;
  • retry the wait against that id (5 attempts, 30s apart, --timeout 30m). Retrying the submission would re-upload a ~120 MB artifact and open a second queue entry at Apple; retrying the wait just asks again about work already in flight.
  • then check notarytool info for Accepted. wait exiting 0 means Apple finished, not that it approved — the old code would have stapled straight through a rejection, and stapler failing afterwards is a much worse error message than the notary log. On rejection it now dumps notarytool log.

Verification

The output parsing is the fragile part, so I checked both awk extractions against real notarytool output shapes, including the case that matters most:

input parsed
submit output (two id: lines — "Submission ID received" then "Successfully uploaded") first id, d0dc4559-…
info with status: Accepted Accepted
info with status: Invalid Invalid → fails the step, dumps the log

The duplicate id: line in submit output is why the extraction takes the first match and exits rather than the last.

🤖 Generated with Claude Code

The first 0.2.3 publish failed after a successful upload: notarytool's
status poll hit NSURLErrorDomain -1001 while the submission was still
In Progress, and `submit --wait` surfaced that as a step failure. Twenty
minutes of signed build discarded over a transient GET, with a valid
submission id sitting right there in the log.

Splitting submit from wait makes the retry target the right thing. Retrying
the submission would re-upload a 120MB artifact and start a second queue
entry; retrying the wait just asks Apple again about work it is already
doing. Also check `notarytool info` for Accepted afterwards — `wait`
exiting 0 means Apple finished, not that it approved, and the old code
would have stapled straight through a rejection.

Relevant because th-9c3f4e doubled the number of notarization round-trips
per release (the app now gets its own ticket, not just the DMG), so this
flake had twice the surface to land on.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Sep 17, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 59cdb82

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@smooai/smooth Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@brentrager
brentrager enabled auto-merge (squash) September 17, 2026 19:14
@brentrager
brentrager merged commit 5bdab78 into main Sep 17, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant