diff --git a/lib/s3.ts b/lib/s3.ts index c45a6569..1261f18d 100644 --- a/lib/s3.ts +++ b/lib/s3.ts @@ -90,7 +90,10 @@ export async function listUserObjects(userId: string, folder: string) { type: 'file', mime: item.Key?.endsWith('.md') ? 'text/markdown' : 'application/octet-stream', etag: item.ETag - })) || []; + })) + // Filter out placeholder files and empty directory markers + .filter(item => !item.title.startsWith('.placeholder') && item.title !== '') + || []; } catch (error) { console.error('Error listing objects:', error); throw error;