Skip to content

Commit fcc9b60

Browse files
committed
fix(replay): thread record-time tree through the extracted suggestion helper
Rebase-conflict resolution against origin/main. #1217 (typed direct Maestro engine) extracted `buildReplayDivergenceSuggestionForNode` out of `resolveSuggestionCandidate` and added a second caller in `session-replay-maestro-failure.ts`. My #1269 change had added `nodes` to the `buildSelectorChainForNode` call that #1217 moved into the extracted helper, so after rebase the helper referenced an out-of-scope `nodes`. Thread the record-time tree as a required `nodes` param on the helper and pass it from BOTH callers (each already has it in scope). This keeps the non-unique-id demotion applied wherever a divergence/repair suggestion chain is built — now including the typed-Maestro suggestion path — with no behavior change for the already-unique-id case.
1 parent 80c1b3e commit fcc9b60

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

src/daemon/handlers/session-replay-divergence.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -536,6 +536,7 @@ function resolveSuggestionCandidate(params: {
536536
return {
537537
suggestion: buildReplayDivergenceSuggestionForNode({
538538
node: resolved.node,
539+
nodes,
539540
session,
540541
action,
541542
basis,
@@ -548,12 +549,14 @@ function resolveSuggestionCandidate(params: {
548549

549550
export function buildReplayDivergenceSuggestionForNode(params: {
550551
node: SnapshotNode;
552+
/** The record-time tree the node came from, for #1269 non-unique-id demotion in the chain. */
553+
nodes: readonly SnapshotNode[];
551554
session: SessionState;
552555
action: ReplayReportAction;
553556
basis: ReplayDivergenceSuggestionBasis;
554557
sanitize: DivergenceFieldSanitizer;
555558
}): ReplayDivergenceSuggestion {
556-
const { node, session, action, basis, sanitize } = params;
559+
const { node, nodes, session, action, basis, sanitize } = params;
557560
const selectorChain = buildSelectorChainForNode(node, session.device.platform, {
558561
action:
559562
action.command === 'fill' ? 'fill' : isTouchTargetCommand(action.command) ? 'click' : 'get',

src/daemon/handlers/session-replay-maestro-failure.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ function collectTypedMaestroSuggestions(params: {
210210
).map(({ node, basis }) =>
211211
buildReplayDivergenceSuggestionForNode({
212212
node,
213+
nodes: params.nodes,
213214
session: params.session,
214215
action: params.action,
215216
basis,

0 commit comments

Comments
 (0)