File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
packages/app/lib/apps/background-sync Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -171,7 +171,7 @@ We automatically synchronize all repositories you granted us access to via the G
171171 response => response . data . filter ( issue => ! ( 'pull_request' in issue ) )
172172 ) ,
173173
174- // open pulls
174+ // open pulls, all
175175 octokit . paginate (
176176 octokit . pulls . list ,
177177 {
@@ -324,12 +324,23 @@ We automatically synchronize all repositories you granted us access to via the G
324324 let expired = false ;
325325 let removed = false ;
326326
327+ // if an open issue or pull request links to
328+ // a non-existing repository, then it must have been
329+ // removed
327330 if ( ! repositories [ issue . repository . id ] ) {
328331 log . debug ( { issue : key } , 'cleanup -> repository removed' ) ;
329332
330333 removed = true ;
331334 }
332335
336+ // if an open pull request was not found (we always
337+ // fetch all), then it must have been deleted
338+ if ( issue . pull_request && issue . state === 'open' ) {
339+ log . debug ( { issue : key } , 'cleanup -> pull request deleted' ) ;
340+
341+ removed = true ;
342+ }
343+
333344 const updatedTime = new Date ( updated_at ) . getTime ( ) ;
334345
335346 if ( updatedTime < expiryTime ) {
You can’t perform that action at this time.
0 commit comments