Prefer last comment when there are multiple to choose from

This commit is contained in:
Mario Campos
2026-10-30 09:35:55 -05:00
parent a5878670a9
commit 0bc39f9ffc
2 changed files with 2 additions and 2 deletions

View File

@@ -193,7 +193,7 @@ describe("findExistingComment", async () => {
1,
"marker",
);
assert.equal(id, 2);
assert.equal(id, 3);
});
await it("returns undefined when no comment matches", async () => {

View File

@@ -112,7 +112,7 @@ export async function findExistingComment(
"Use a unique marker for each distinct managed comment to avoid this situation.",
);
}
return markedComments[0]?.id;
return markedComments.at(-1)?.id;
}
/**