Skip to content

Commit 02ed53e

Browse files
committed
fix: avoid redundant swipe stabilization flag
1 parent 994687d commit 02ed53e

3 files changed

Lines changed: 9 additions & 20 deletions

File tree

src/compat/maestro/__tests__/runtime-interactions.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ test('invokeMaestroSwipeScreen preserves vertical percentage endpoints', async (
196196

197197
expect(response.ok).toBe(true);
198198
expect(swipes).toEqual([['200', '600', '200', '280', '300']]);
199-
expect(swipeFlags[0]?.postGestureStabilization).toBe(true);
199+
expect(swipeFlags[0]?.postGestureStabilization).toBeUndefined();
200200
});
201201

202202
test('invokeMaestroSwipeScreen keeps Android horizontal percentage swipes on the content lane', async () => {

src/compat/maestro/runtime-interactions.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -239,10 +239,6 @@ async function invokeSwipeGesture(
239239
String(swipe.end.y),
240240
...(durationMs ? [durationMs] : []),
241241
],
242-
flags: {
243-
...params.baseReq.flags,
244-
postGestureStabilization: true,
245-
},
246242
});
247243
}
248244

src/daemon/handlers/snapshot-capture.ts

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ import {
3636
emitInteractionSettleTimeout,
3737
getActivePendingInteractionOutcome,
3838
retryPendingInteractionOutcome,
39-
type InteractionSurfaceChange,
4039
} from '../interaction-outcome-policy.ts';
4140
import {
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

207200
export async function captureSnapshotData(params: CaptureSnapshotParams): Promise<SnapshotData> {

0 commit comments

Comments
 (0)