File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed
Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,8 @@ test('polls SFTP folder', async () => {
2525 'download-dir/sftp-environment/proofs' : directoryType ,
2626 'download-dir/sftp-environment/proofs/client_campaign_template-1_en_x0' :
2727 directoryType ,
28+ 'download-dir/sftp-environment/proofs/unexpected-id-format' :
29+ directoryType ,
2830 } ;
2931
3032 return existsMappings [ path ] ?? false ;
@@ -44,6 +46,8 @@ test('polls SFTP folder', async () => {
4446 mockPdfBuffer ,
4547 'download-dir/sftp-environment/proofs/client_campaign_template-1_en_x0/proof-2.pdf' :
4648 mockPdfBuffer ,
49+ 'download-dir/sftp-environment/proofs/unexpected-id-format/proof-1.pdf' :
50+ mockPdfBuffer ,
4751 'download-dir/sftp-environment/proofs/client_campaign_template-1_en_x0/invalid-file.pdf' :
4852 mockMalformedPdfBuffer ,
4953 } [ path ] ;
@@ -101,6 +105,13 @@ test('polls SFTP folder', async () => {
101105 modifyTime : Date . now ( ) ,
102106 } ,
103107 ] ,
108+ 'download-dir/sftp-environment/proofs/unexpected-id-format' : [
109+ {
110+ name : 'proof-1.pdf' ,
111+ type : fileType ,
112+ modifyTime : Date . now ( ) ,
113+ } ,
114+ ] ,
104115 } ) [ path ] ?? [ ] ,
105116 } ) ;
106117
Original file line number Diff line number Diff line change @@ -98,15 +98,15 @@ export class App {
9898 const idLogger = logger . child ( { expandedTemplateId, templateId } ) ;
9999
100100 for ( const proofFile of proofFiles ) {
101- if ( proofFile . type === '-' ) {
101+ if ( proofFile . type === '-' && templateId ) {
102102 await this . copyFileToS3 (
103103 sftpClient ,
104104 `${ baseSftpPath } /${ expandedTemplateId } /${ proofFile . name } ` ,
105105 `${ baseS3Path } /${ templateId } /${ proofFile . name } ` ,
106106 logger
107107 ) ;
108108 } else {
109- idLogger . info ( 'Unexpected non-file item found' ) ;
109+ idLogger . info ( 'Unexpected item found' , { proofFile } ) ;
110110 }
111111 }
112112 }
You can’t perform that action at this time.
0 commit comments