You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit d30811b
Browse filesBrowse the repository at this point in the historyBrowse files
fix(ui): make request IDs and copying work over plain HTTP (#1583)
* fix(ui): make request IDs and copying work over plain HTTP
`crypto.randomUUID` and `navigator.clipboard` exist only in secure
contexts (HTTPS or localhost). Served over plain HTTP behind a proxy,
every action that makes an ID failed with "crypto.randomUUID is not a
function": starting, cancelling and rerunning runs, acknowledging, and
changing triggers. Copy buttons either threw or said "Copied" without
copying.
- `newRequestId()` uses `crypto.randomUUID` where it exists, and
otherwise builds an RFC 4122 version 4 UUID from
`crypto.getRandomValues`, which every context has.
- `copyText()` uses the Clipboard API where it exists and works, and
otherwise copies from a hidden textarea. Copy buttons say "Copied"
only when the text was copied.
- A unit check keeps `crypto.randomUUID` and `navigator.clipboard` out
of everything but these two helpers.
- Tests: the fallback's format, version and variant bits, and
uniqueness; in a browser with both APIs removed before the app loads,
a plan (which makes a request ID) opens, and Copy as sqb build copies.
* fix(ui): keep the selection when copying without the Clipboard API, and help copy a secret by hand
- The fallback copy puts back the person's own selection and focus,
without scrolling, after copying from its hidden textarea.
- When a one-time secret can't be copied, it is selected, with a hint to
copy it with Ctrl+C (⌘C on a Mac).
constbody={run_id: crypto.randomUUID(),source_run_id: runId,from_failure: false, nodes,priority: source.priority,reason: 'Rerun selected nodes from the web UI'};
496
+
constbody={run_id: newRequestId(),source_run_id: runId,from_failure: false, nodes,priority: source.priority,reason: 'Rerun selected nodes from the web UI'};
constbody={run_id: crypto.randomUUID(),source_run_id: runId,from_failure: mode==='from_failure',priority: source.priority,reason: 'Rerun from the web UI'};
514
+
constbody={run_id: newRequestId(),source_run_id: runId,from_failure: mode==='from_failure',priority: source.priority,reason: 'Rerun from the web UI'};
constbody={run_id: crypto.randomUUID(),location_id: locationId, target,command: request.command,priority: request.priority,reason: 'Started from the web UI'};
580
+
constbody={run_id: newRequestId(),location_id: locationId, target,command: request.command,priority: request.priority,reason: 'Started from the web UI'};
constreason=fullRefresh ? 'Full refresh started from the web UI' : window ? 'Backfill started from the web UI' : narrowed ? 'Part of the job started from the web UI' : 'Started from the web UI';
0 commit comments