@@ -36,7 +36,6 @@ import {
3636 emitInteractionSettleTimeout ,
3737 getActivePendingInteractionOutcome ,
3838 retryPendingInteractionOutcome ,
39- type InteractionSurfaceChange ,
4039} from '../interaction-outcome-policy.ts' ;
4140import {
4241 capturePostGestureStabilizedResult ,
@@ -124,32 +123,30 @@ async function captureInteractionOutcomeAwareSnapshot(
124123
125124 const startedAt = Date . now ( ) ;
126125 let retryAttempts = 0 ;
127- let settled = await waitForDelayedInteractionSurfaceChange (
126+ let latest = await waitForDelayedInteractionSurfaceChange (
128127 params ,
129128 pending ,
130129 await capturePostActionSnapshotAttempt ( params ) ,
131130 ) ;
132- let latest = settled . latest ;
133131 let outcome = await retryPendingInteractionOutcome ( {
134132 session,
135133 pending,
136134 logPath : params . logPath ,
137- snapshot : settled . latest . snapshot ,
135+ snapshot : latest . snapshot ,
138136 } ) ;
139137
140138 while ( outcome . retried ) {
141139 retryAttempts += 1 ;
142- settled = await waitForDelayedInteractionSurfaceChange (
140+ latest = await waitForDelayedInteractionSurfaceChange (
143141 params ,
144142 pending ,
145143 await capturePostActionSnapshotAttempt ( params ) ,
146144 ) ;
147- latest = settled . latest ;
148145 outcome = await retryPendingInteractionOutcome ( {
149146 session,
150147 pending,
151148 logPath : params . logPath ,
152- snapshot : settled . latest . snapshot ,
149+ snapshot : latest . snapshot ,
153150 } ) ;
154151 }
155152
@@ -186,22 +183,18 @@ async function waitForDelayedInteractionSurfaceChange(
186183 params : CaptureSnapshotParams & { session : SessionState } ,
187184 pending : NonNullable < SessionState [ 'pendingInteractionOutcome' ] > ,
188185 initial : SnapshotAttempt ,
189- ) : Promise < { latest : SnapshotAttempt ; change : InteractionSurfaceChange } > {
186+ ) : Promise < SnapshotAttempt > {
190187 let latest = initial ;
191- let change = classifyInteractionSurfaceChange (
188+ const change = classifyInteractionSurfaceChange (
192189 pending . preSignature ,
193190 buildInteractionSurfaceSignature ( latest . snapshot . nodes ) ,
194191 ) ;
195- if ( change !== 'unchanged' ) return { latest, change } ;
192+ if ( change !== 'unchanged' ) return latest ;
196193
197194 await sleep ( INTERACTION_CHANGE_RECHECK_DELAY_MS ) ;
198195 latest = await capturePostActionSnapshotAttempt ( params ) ;
199- change = classifyInteractionSurfaceChange (
200- pending . preSignature ,
201- buildInteractionSurfaceSignature ( latest . snapshot . nodes ) ,
202- ) ;
203196
204- return { latest, change } ;
197+ return latest ;
205198}
206199
207200export async function captureSnapshotData ( params : CaptureSnapshotParams ) : Promise < SnapshotData > {
0 commit comments