Skip to content

Commit

Permalink
invocation_exec_log_card: fix invalid href local runner entries
Browse files Browse the repository at this point in the history
While working on #7166, I discovered that clicking on `local` actions in
the execution log card would crash our UI.

This is because local spawn entry does not have `digest` and thus,
render the entries in the card with `href=/invocation/<uuid>$#action`,
and clicking on it would cause our browser to crash.

Don't render the invalid URL here.
  • Loading branch information
sluongng committed Aug 8, 2024
1 parent 7114cf4 commit eae97de
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/invocation/invocation_exec_log_card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -169,12 +169,13 @@ export default class InvocationExecLogCardComponent extends React.Component<Prop
}

getActionPageLink(entry: tools.protos.ExecLogEntry) {
const search = new URLSearchParams();
if (entry.spawn?.digest) {
const search = new URLSearchParams();
search.set("actionDigest", digestToString(entry.spawn.digest));
return `/invocation/${this.props.model.getInvocationId()}?${search}#action`;
}

return `/invocation/${this.props.model.getInvocationId()}?${search}#action`;
return undefined;
}

render() {
Expand Down

0 comments on commit eae97de

Please sign in to comment.