fix: Fix workflow replay after updating starting URL (#2773)
Resolves https://github.com/webrecorder/browsertrix/issues/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/
This commit is contained in:
		
							parent
							
								
									1824fa0757
								
							
						
					
					
						commit
						04f5ec856f
					
				| @ -1891,7 +1891,9 @@ export class WorkflowDetail extends BtrixElement { | |||||||
| 
 | 
 | ||||||
|     return html` |     return html` | ||||||
|       <div class="aspect-video overflow-hidden rounded-lg border"> |       <div class="aspect-video overflow-hidden rounded-lg border"> | ||||||
|         ${guard([this.lastCrawlId], this.renderReplay)} |         ${guard([this.lastCrawlId], () => | ||||||
|  |           when(this.latestCrawlTask.value, this.renderReplay), | ||||||
|  |         )} | ||||||
|       </div> |       </div> | ||||||
|     `;
 |     `;
 | ||||||
|   }; |   }; | ||||||
| @ -1958,18 +1960,15 @@ export class WorkflowDetail extends BtrixElement { | |||||||
|     `;
 |     `;
 | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   private readonly renderReplay = () => { |   private readonly renderReplay = (latestCrawl: Crawl) => { | ||||||
|     if (!this.workflow || !this.lastCrawlId) return; |     const replaySource = `/api/orgs/${latestCrawl.oid}/crawls/${this.lastCrawlId}/replay.json`; | ||||||
| 
 |  | ||||||
|     const replaySource = `/api/orgs/${this.workflow.oid}/crawls/${this.lastCrawlId}/replay.json`; |  | ||||||
|     const headers = this.authState?.headers; |     const headers = this.authState?.headers; | ||||||
|     const config = JSON.stringify({ headers }); |     const config = JSON.stringify({ headers }); | ||||||
| 
 | 
 | ||||||
|     return html` |     return html` | ||||||
|       <replay-web-page |       <replay-web-page | ||||||
|         source="${replaySource}" |         source="${replaySource}" | ||||||
|         url="${(this.workflow.seedCount === 1 && this.workflow.firstSeed) || |         url="${(latestCrawl.seedCount === 1 && latestCrawl.firstSeed) || ""}" | ||||||
|         ""}" |  | ||||||
|         config="${config}" |         config="${config}" | ||||||
|         replayBase="/replay/" |         replayBase="/replay/" | ||||||
|         noSandbox="true" |         noSandbox="true" | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user