mirror of
https://github.com/dessant/lock-threads.git
synced 2026-03-13 01:27:03 -04:00
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.
This commit is contained in:
13
src/lock.js
13
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) {
|
||||
|
||||
Reference in New Issue
Block a user