Commit Graph
4 Commits
Author SHA1 Message Date
Michael Wang e83ddaed28 fix(cli): escape remaining project and sign-in text, ignore stateless callbacks (#8177)
* fix(cli): batch render, cloud render and publish print project text as visible escapes

A batch render printed each failed row's error straight to the terminal. The
error can quote file names and attribute values from the project, so control
characters in them could move the cursor, rewrite earlier lines, set the
window title or write the clipboard. That line, and the manifest path in the
batch header, now go through terminalLines() and terminalText(), which keep
real line breaks and show every other control character as an escape.

cloud render does the same for the media lines it offloads, the "also stays in
the zip" line, the largest-files list, the aspect-ratio detection line and the
names of fonts that are not on this computer. publish does the same for the
composition path in the blank-entry hint and for the publish failure message.

The manifest file and --json output are unchanged.

* fix(cli): sign-in callback ignores requests without the login's state

The browser sign-in listens on a local port for the redirect back from the
sign-in page. It acted on an error in that redirect before checking the
state value, so any page or local process that reached the port could end a
pending sign-in and put its own text in the terminal. A request with a
missing or wrong state also ended the sign-in.

Now only a request carrying the login's state can end it. Any other request
gets the same 400 page as before and the listener keeps waiting for the real
redirect or the timeout. A sign-in that is cancelled or fails on the sign-in
page still carries the state, so it reports the failure as it does today.

The error text from the redirect, and the "Sign-in failed" line, now show
control characters as visible escapes.

* fix(cli): variable issues and oversize file list print control characters as escapes

Variable issue lines from render and render --batch printed the variable ids
and allowed options from the project's data-composition-variables as they
were. Each line now goes through terminalText(), so control characters,
line feeds included, show as visible escapes. The issue objects and their
messages are unchanged for other callers.

When a cloud render project is over the upload limit, the list of its largest
files now escapes each path, line feeds included, so a file name cannot add a
line of its own.

Font names in the cloud render notice are looked up as written and escaped
only when printed, so a name with a trailing control character keeps its
look-alike suggestion.

* fix(cli): a callback from another sign-in says the terminal is still waiting

The 400 page for a callback without the login's state now tells the person to finish signing in
from the newest tab, since the terminal keeps waiting instead of ending the login.
2026-11-18 17:19:49 +00:00
Miguel Ángel 9acdce4a25 feat(cli): the sign-in page the browser lands on follows the design (#7332)
* feat(cli): the sign-in page the browser lands on follows the design

* style(cli): format the sign-in page files

* fix(cli): the sign-in page picks Cancel or failure inside the page builder, and drops unused code
2026-11-06 20:27:17 +00:00
Vance IngallsandClaude Opus 5.5 34ddced2d0 fix(cli): keep browser sign-in open through checkout (#6879)
* fix(cli): keep browser sign-in open through checkout

The loopback listener timed out after 5 minutes, but plan checkout runs
inside the OAuth flow. A slower purchase ended on ERR_CONNECTION_REFUSED.
Raise the default to 60 minutes, matching pacific's plan-checkout handoff.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* fix(cli): show the sign-in limit and how to recover

The waiting line now states the 60-minute limit and Ctrl+C. After a
timed-out browser login the CLI says to run auth login again.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* fix(cli): drop unverified purchase claim, harden timer test, document limit

Review fixes: the timeout hint no longer says purchases stay on the account
(the CLI cannot observe billing); the no-timer-left test now asserts before
any explicit close() and uses node:http so undici timers cannot pollute the
count; docs mention the 60-minute window and Ctrl+C.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* fix(cli): close the sign-in listener on every path and record Ctrl+C

Ctrl+C is now the advertised exit, but events only flush on exit, which a
default SIGINT skips, so an abandoned login vanished from telemetry. Record
it as aborted and exit 130 through requestCliExit. Close the listener on any
throw, so a failure before the wait can't hold the process for the full
window. Derive the waiting line and timeout message from the listener's own
limit, and name the constant for why it is long, which clears the comment
ratchet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-01 12:29:35 -08:00
James 81aff68397 fix(cli): address code-review findings on OAuth PR 2026-05-28 05:59:24 +00:00