Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only strip file extension if a file has one #1764

Merged
merged 1 commit into from
Jun 2, 2024

Conversation

Mikey032
Copy link
Contributor

@Mikey032 Mikey032 commented May 29, 2024

Fixes #1734

When a filename lacks an extension, the entire base filename is removed. When files are uploaded through the sidebar's 'New Files' button, the extension is already stripped from the filename. However, uploading files directly via the chat retains the extension. This change enables both scenarios to function while preserving the base filename.


🚀 This description was created by Ellipsis for commit 43d56bb

Summary:

This PR updates the createFile function to correctly handle filenames with and without extensions, fixing a bug where filenames without extensions were incorrectly stripped.

Key points:

  • Updated createFile function in db/files.ts to handle filenames with and without extensions.
  • Introduced a check for the presence of a file extension before stripping it.
  • Fixes issue where filenames without extensions were incorrectly processed, preserving the base filename.

Generated with ❤️ by ellipsis.dev

Copy link

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ Changes requested. Reviewed everything up to 43d56bb in 51 seconds

More details
  • Looked at 15 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 0 drafted comments based on config settings.

Workflow ID: wflow_aX4NVmVUhKqX2txd


Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

db/files.ts Show resolved Hide resolved
@mckaywrigley mckaywrigley merged commit ef4f8f3 into mckaywrigley:main Jun 2, 2024
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.

File upload disregards filename
2 participants