refactor(runner): drop the empty branch from the hold path

This commit is contained in:
pj committed 2026-08-15 21:44:21 +05:30
1 parent 5aee168098
commit 7d4e85f407
1 file changed
+5 -5
+5 -5
View File
@@ -318,10 +318,7 @@ func Run(ctx context.Context, options Options) (Summary, error) {
} }
applySkipped := held applySkipped := held
if held { if nextErr == nil && !appIsForeground(ctx, options) {
// lastAction is left exactly as it is: it is still the action the
// next verified step has to be told about.
} else if nextErr == nil && !appIsForeground(ctx, options) {
// The app left the foreground between observe and apply (a prior // The app left the foreground between observe and apply (a prior
// action's gesture settling late, or an async navigation). The // action's gesture settling late, or an async navigation). The
// chosen action's coordinates reference a tree that no longer // chosen action's coordinates reference a tree that no longer
@@ -365,9 +362,12 @@ func Run(ctx context.Context, options Options) (Summary, error) {
applied.Applied = true applied.Applied = true
lastAction = &applied lastAction = &applied
} }
} else { } else if !held {
lastAction = nil lastAction = nil
} }
// A held step leaves lastAction alone on purpose: nothing ran here, and
// the action it points at is still the one the next verified step has to
// be told about.
step := trace.Step{ step := trace.Step{
Index: stepIndex, Index: stepIndex,