Azure / Azure/azure-rest-api-specs
[summarize-checks] Multiple NSTM comments race condition
- Dominant language
- TypeSpec
- Stars
- 3.1k
- Forks
- 5.9k
- Avg merge
- 2d 22h
- Merged PRs (30d)
- 444
Description
https://github.com/Azure/azure-rest-api-specs/pull/36681
Looks like a race condition, where two instances of summarize-checks ran at exactly the same time, saw no existing comment, and added a new one.
https://github.com/Azure/azure-rest-api-specs/actions/runs/16980229351/job/48138479097#step:4:35
https://github.com/Azure/azure-rest-api-specs/actions/runs/16980229254/job/48138478854#step:4:35
Potential fix:
```js
const existingComments = getExistingComments(prNumber);
if (existingComments.contains(NSTM)) {
editComment();
}
else {
addNewComment();
// new code
const afterComments = getExistingComments(prNumber);
if (afterComments.containsMultiple(NSTM)) {
deleteCommentWeAdded();
updateExistingComment();
}
}
```
Contributor guide
Assessment
This issue has not been assessed yet.