Skip to content

Commit 04f5ec8

Browse files
authored
fix: Fix workflow replay after updating starting URL (#2773)
Resolves #2764 ## Changes Uses crawl first seed as starting URL instead of workflow first seed to fix replay after saving workflow without running. ## Manual testing 1. Log in as crawler 2. Create a new workflow and crawl a single page, for example, https://example.com/ 3. Edit the workflow to change starting URL to https://example.org/ 4. Save without running 5. Go to latest crawl tab, verify replay loads https://example.com/
1 parent 1824fa0 commit 04f5ec8

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

frontend/src/pages/org/workflow-detail.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1891,7 +1891,9 @@ export class WorkflowDetail extends BtrixElement {
18911891

18921892
return html`
18931893
<div class="aspect-video overflow-hidden rounded-lg border">
1894-
${guard([this.lastCrawlId], this.renderReplay)}
1894+
${guard([this.lastCrawlId], () =>
1895+
when(this.latestCrawlTask.value, this.renderReplay),
1896+
)}
18951897
</div>
18961898
`;
18971899
};
@@ -1958,18 +1960,15 @@ export class WorkflowDetail extends BtrixElement {
19581960
`;
19591961
}
19601962

1961-
private readonly renderReplay = () => {
1962-
if (!this.workflow || !this.lastCrawlId) return;
1963-
1964-
const replaySource = `/api/orgs/${this.workflow.oid}/crawls/${this.lastCrawlId}/replay.json`;
1963+
private readonly renderReplay = (latestCrawl: Crawl) => {
1964+
const replaySource = `/api/orgs/${latestCrawl.oid}/crawls/${this.lastCrawlId}/replay.json`;
19651965
const headers = this.authState?.headers;
19661966
const config = JSON.stringify({ headers });
19671967

19681968
return html`
19691969
<replay-web-page
19701970
source="${replaySource}"
1971-
url="${(this.workflow.seedCount === 1 && this.workflow.firstSeed) ||
1972-
""}"
1971+
url="${(latestCrawl.seedCount === 1 && latestCrawl.firstSeed) || ""}"
19731972
config="${config}"
19741973
replayBase="/replay/"
19751974
noSandbox="true"

0 commit comments

Comments
 (0)