File tree Expand file tree Collapse file tree 5 files changed +37
-4
lines changed Expand file tree Collapse file tree 5 files changed +37
-4
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " trigger.dev " : patch
3+ ---
4+
5+ - Reduce restore times by 5s due to immediate polling
6+ - Fix ` s is not a function ` and surface underlying error messages
Original file line number Diff line number Diff line change @@ -514,7 +514,7 @@ export class ManagedRunController {
514514 supervisorApiUrl : this . env . TRIGGER_SUPERVISOR_API_URL ,
515515 } ;
516516
517- await this . currentExecution . processEnvOverrides ( "socket disconnected" ) ;
517+ await this . currentExecution . processEnvOverrides ( "socket disconnected" , true ) ;
518518
519519 const newEnv = {
520520 workerInstanceName : this . env . TRIGGER_WORKER_INSTANCE_NAME ,
Original file line number Diff line number Diff line change @@ -896,7 +896,10 @@ export class RunExecution {
896896 /**
897897 * Processes env overrides from the metadata service. Generally called when we're resuming from a suspended state.
898898 */
899- public async processEnvOverrides ( reason ?: string ) : Promise < { overrides : Metadata } | null > {
899+ public async processEnvOverrides (
900+ reason ?: string ,
901+ shouldPollForSnapshotChanges ?: boolean
902+ ) : Promise < { overrides : Metadata } | null > {
900903 if ( ! this . metadataClient ) {
901904 return null ;
902905 }
@@ -943,6 +946,12 @@ export class RunExecution {
943946 this . httpClient . updateRunnerId ( this . env . TRIGGER_RUNNER_ID ) ;
944947 }
945948
949+ // Poll for snapshot changes immediately
950+ if ( shouldPollForSnapshotChanges ) {
951+ this . sendDebugLog ( "[override] polling for snapshot changes" , { reason } ) ;
952+ this . fetchAndProcessSnapshotChanges ( "restore" ) . catch ( ( ) => { } ) ;
953+ }
954+
946955 return {
947956 overrides,
948957 } ;
Original file line number Diff line number Diff line change @@ -57,12 +57,30 @@ const wrappedClackSpinner = () => {
5757 spinner . start ( truncateMessage ( currentMessage ) ) ;
5858 } ,
5959 stop : ( msg ?: string , code ?: number ) : void => {
60- isActive = false ;
6160 process . stdout . off ( "resize" , handleResize ) ;
61+
62+ if ( ! isActive ) {
63+ // Spinner was never started, just display the message
64+ if ( msg ) {
65+ log . message ( msg ) ;
66+ }
67+ return ;
68+ }
69+
70+ isActive = false ;
6271 spinner . stop ( truncateMessage ( msg ?? "" ) , code ) ;
6372 } ,
6473 message : ( msg ?: string ) : void => {
6574 currentMessage = msg ?? "" ;
75+
76+ if ( ! isActive ) {
77+ // Spinner was never started, just display the message
78+ if ( msg ) {
79+ log . message ( msg ) ;
80+ }
81+ return ;
82+ }
83+
6684 spinner . message ( truncateMessage ( currentMessage ) ) ;
6785 } ,
6886 } ;
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ if [[ -z "${GITHUB_TOKEN}" ]]; then
2424fi
2525
2626# Use the first argument as version or 'v3-prerelease' if not available
27- version=${1:- ' v3 -prerelease' }
27+ version=${1:- ' v4 -prerelease' }
2828
2929# Ensure git stage is clear
3030if [[ $( git status --porcelain) ]]; then
You can’t perform that action at this time.
0 commit comments