Skip to content

Fix file upload bug: inverted condition prevented files from being saved#4

Merged
inventionpro merged 1 commit intoParley-Chat:mainfrom
TerryCodes:main
Feb 22, 2026
Merged

Fix file upload bug: inverted condition prevented files from being saved#4
inventionpro merged 1 commit intoParley-Chat:mainfrom
TerryCodes:main

Conversation

@TerryCodes
Copy link
Copy Markdown
Contributor

Issue

Sending files (encrypted or not) weren't being saved and blank messages were sent.

Root Cause

In , the condition for processing file uploads had inverted logic:

This required (file too big) AND (file within limits) simultaneously. This is impossible to satisfy, so files were never processed.

Fix

Simplified the condition to check if the file exists and is within size limits:

Testing

Files should now be properly saved and messages with attachments will include the attachment data instead of appearing blank.

The condition in sending_messages() required content_length > max_file_size
AND chunked_size <= max_file_size simultaneously, which is impossible.
This caused files to never be saved, resulting in blank messages.

Fixed by simplifying to: file exists AND size <= max_file_size
@inventionpro inventionpro merged commit 257b9ee into Parley-Chat:main Feb 22, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants