Skip to content
This repository has been archived by the owner on Aug 3, 2021. It is now read-only.

Commit

Permalink
fix: skip wrong search results
Browse files Browse the repository at this point in the history
Some search results include locked issues when the `is:unlocked`
search qualifier is used. This change filters them out
and processes the rest.
  • Loading branch information
dessant committed Jan 19, 2019
1 parent 00e6b14 commit 5b94ab5
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions src/lock.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,17 +93,8 @@ module.exports = class Lock {
per_page: 30
})).data.items;

// `is:unlocked` search qualifier is undocumented, warn on wrong results
const wrongResults = results.filter(
issue => issue.state === 'open' || issue.locked
);
if (wrongResults.length) {
const issues = wrongResults.map(issue => issue.number);
this.log.warn({query, issues}, 'Wrong search results');
return [];
}

return results;
// `is:unlocked` search qualifier is undocumented, skip wrong results
return results.filter(issue => !issue.locked);
}

getUpdatedTimestamp(days) {
Expand Down

0 comments on commit 5b94ab5

Please sign in to comment.