From 5b94ab56b118834ab1ee5e45eb07d4bc193583b2 Mon Sep 17 00:00:00 2001 From: dessant Date: Sat, 19 Jan 2019 07:42:02 +0200 Subject: [PATCH] fix: skip wrong search results Some search results include locked issues when the `is:unlocked` search qualifier is used. This change filters them out and processes the rest. --- src/lock.js | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/src/lock.js b/src/lock.js index 4a94018..1216104 100644 --- a/src/lock.js +++ b/src/lock.js @@ -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) {