θΏ™ζ˜―indexlocζδΎ›ηš„ζœεŠ‘οΌŒδΈθ¦θΎ“ε…₯任何密码
Skip to content

Skip too large files to read #3416

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

Conversation

marcin-golebiowski
Copy link

Pull Request Type

  • ✨ feat
  • πŸ› fix
  • ♻️ refactor
  • πŸ’„ style
  • πŸ”¨ chore
  • πŸ“ docs

Relevant Issues

It's not possible to view documents if there is a file bigger than 512 MB in documents.

What is in this change?

Skipping the reading the file when the size is bigger than 512 MB.

Additional Information

By preemptively filtering out oversized files, we improve reliability and maintain system efficiency.
Oversized files can happen due to big PDFs with images.

Developer Validations

  • I ran yarn lint from the root of the repo & committed changes
  • Relevant documentation has been updated
  • I have tested my code functionality
  • Docker build succeeds locally

@timothycarambat
Copy link
Member

So in this case, large files just become invisible? How are you ever supposed to be able to select them to embed afterwards?

@marcin-golebiowski
Copy link
Author

The other solution would be to check the size of the file before fs.readFileSync.
In case of huge file the empty content could be returned instead of calling fs.readFileSync which will fail.

@timothycarambat
Copy link
Member

Moved to #3497

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR:needs review Needs review by core team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants