From 8b845261d28c9e402114bae39c55f0b131e20de8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikola=20Dere=C5=BEi=C4=8D?= Date: Fri, 29 Aug 2025 22:12:23 +0200 Subject: [PATCH 1/6] fix: prevent empty file from overwriting existing bill attachments MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix updateOrAddBill to check file size before processing attachment, preventing empty blob files from overwriting existing attachments when updating bill properties. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- app/lib/actions/billActions.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/lib/actions/billActions.ts b/app/lib/actions/billActions.ts index 89a22fb..2ebb595 100644 --- a/app/lib/actions/billActions.ts +++ b/app/lib/actions/billActions.ts @@ -150,7 +150,9 @@ export const updateOrAddBill = withUser(async (user:AuthenticatedUser, locationI // update the bill in the mongodb const dbClient = await getDbClient(); - const billAttachment = await serializeAttachment(formData.get('billAttachment') as File); + const billAttachmentFile = formData.get('billAttachment') as File; + const billAttachment = billAttachmentFile && billAttachmentFile.size > 0 ? + await serializeAttachment(billAttachmentFile) : null; if(billId) { From 55f64ebca51a9ffe8abb9151e7ea0f51116c954c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikola=20Dere=C5=BEi=C4=8D?= Date: Fri, 29 Aug 2025 22:17:55 +0200 Subject: [PATCH 2/6] chore: add Serena AI assistant entries to .gitignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add .serena/ directory and *.serena-memory files to prevent tracking of AI assistant configuration and memory files. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- .gitignore | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitignore b/.gitignore index 9750d07..13bfe6f 100644 --- a/.gitignore +++ b/.gitignore @@ -44,3 +44,7 @@ mongo-volume-backup-*.tar.gz # backups directory for mongo-volume tarballs /backups/ + +# Serena AI assistant +.serena/ +*.serena-memory From 85c69756b716f9df36a0e71a7d24bd98e79aa046 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikola=20Dere=C5=BEi=C4=8D?= Date: Fri, 29 Aug 2025 22:19:08 +0200 Subject: [PATCH 3/6] feat: add MCP configuration for Serena and Context7 servers --- .mcp.json | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .mcp.json diff --git a/.mcp.json b/.mcp.json new file mode 100644 index 0000000..88ff178 --- /dev/null +++ b/.mcp.json @@ -0,0 +1,19 @@ +{ + "mcpServers": { + "serena": { + "command": "uvx", + "args": [ + "--from", + "git+https://github.com/oraios/serena", + "serena", + "start-mcp-server", + "--enable-web-dashboard", + "false" + ] + }, + "context7": { + "type": "http", + "url": "https://mcp.context7.com/mcp" + } + } +} \ No newline at end of file From 9c7bf8244964a36f8c35b9cb7e1f4d502713a862 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikola=20Dere=C5=BEi=C4=8D?= Date: Fri, 29 Aug 2025 22:19:30 +0200 Subject: [PATCH 4/6] feat: add GitHub MCP server configuration --- .mcp.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.mcp.json b/.mcp.json index 88ff178..39c10ff 100644 --- a/.mcp.json +++ b/.mcp.json @@ -14,6 +14,10 @@ "context7": { "type": "http", "url": "https://mcp.context7.com/mcp" + }, + "github": { + "type": "http", + "url": "https://api.githubcopilot.com/mcp" } } } \ No newline at end of file From 3d7d5ed00926cadb4b774decad061dbeb3b48f64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikola=20Dere=C5=BEi=C4=8D?= Date: Fri, 29 Aug 2025 22:31:28 +0200 Subject: [PATCH 5/6] feat: configure MCP servers for Serena, Context7 and Git integration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add comprehensive MCP server configuration including: - Serena AI assistant with web dashboard disabled - Context7 documentation server for library lookups - Git server with repository access permissions 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- .mcp.json | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.mcp.json b/.mcp.json index 39c10ff..ad2686c 100644 --- a/.mcp.json +++ b/.mcp.json @@ -15,9 +15,14 @@ "type": "http", "url": "https://mcp.context7.com/mcp" }, - "github": { - "type": "http", - "url": "https://api.githubcopilot.com/mcp" + "git": { + "command": "uvx", + "args": [ + "mcp-server-git" + ], + "env": { + "MCP_GIT_ALLOW": "/home/knee-cola/web-pro/evidencija-rezija" + } } } } \ No newline at end of file From 6c7a3159660d0682090f24e0b6ae47c28d1dab13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikola=20Dere=C5=BEi=C4=8D?= Date: Fri, 29 Aug 2025 22:32:07 +0200 Subject: [PATCH 6/6] fix: prevent empty file from overwriting existing bill attachments MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Improve file attachment handling by: - Adding fileSize === 0 check to prevent empty files from being processed - Simplifying attachment logic by moving size validation to serializeAttachment function - Ensuring null is returned for empty/invalid files to preserve existing attachments 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- app/lib/actions/billActions.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/lib/actions/billActions.ts b/app/lib/actions/billActions.ts index 2ebb595..3a5de12 100644 --- a/app/lib/actions/billActions.ts +++ b/app/lib/actions/billActions.ts @@ -86,7 +86,7 @@ const serializeAttachment = async (billAttachment: File | null) => { lastModified: fileLastModified, } = billAttachment; - if(!fileName || fileName === 'undefined') { + if(!fileName || fileName === 'undefined' || fileSize === 0) { return null; } @@ -150,9 +150,7 @@ export const updateOrAddBill = withUser(async (user:AuthenticatedUser, locationI // update the bill in the mongodb const dbClient = await getDbClient(); - const billAttachmentFile = formData.get('billAttachment') as File; - const billAttachment = billAttachmentFile && billAttachmentFile.size > 0 ? - await serializeAttachment(billAttachmentFile) : null; + const billAttachment = await serializeAttachment(formData.get('billAttachment') as File); if(billId) {