feat: make preview conversion timeout and max file size configurable#5408
Merged
juliusknorr merged 1 commit intoMay 26, 2026
Merged
Conversation
2a2ed3e to
063a515
Compare
There was a problem hiding this comment.
Pull request overview
This PR implements configurable timeout and maximum file size settings for preview conversion operations in the Nextcloud Richdocuments app. The changes address issue #5404 by allowing administrators to customize preview conversion behavior via OCC commands.
Changes:
- Added two new configuration options:
preview_conversion_timeout(default: 5 seconds) andpreview_conversion_max_filesize(default: 100 MB) - Modified the preview generation logic to skip files exceeding the configured size limit
- Updated the conversion service to use the configured timeout for preview requests while maintaining backward compatibility for other conversion operations
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| lib/AppConfig.php | Adds constants and getter methods for the two new configuration options with appropriate defaults |
| lib/Service/RemoteService.php | Adds timeout parameter to convertTo() method and passes configured timeout from convertFileTo() |
| lib/Preview/Office.php | Implements file size check before attempting preview conversion with debug logging |
| docs/app_settings.md | Documents the new configuration options with usage examples |
| tests/lib/AppConfigTest.php | Adds unit tests for the new AppConfig getter methods |
| tests/lib/Preview/OfficeTest.php | Adds unit tests for the new file size checking behavior in preview generation |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
063a515 to
fc9d7c9
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Julius Knorr <jus@bitgrid.net>
fc9d7c9 to
3b8c5ec
Compare
emberfiend
approved these changes
May 26, 2026
Collaborator
|
/backport to stable31 please |
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Attempt to implement with Claude Sonnet 4.6 and a custom agent definition, therefore collecting my personal feedback on that a bit here:
Create a branch, Implement the feature described in https://github.com/nextcloud/richdocuments/issues/5404 and open a pull request for itSummary
Fixes #5404
Adds two new configurable options for preview conversion:
Both options can be set via
occ config:app:set:Changes
PREVIEW_CONVERSION_TIMEOUTandPREVIEW_CONVERSION_MAX_FILESIZEconstants + getter methods toAppConfigOffice::getThumbnailnow skips conversion when file size exceeds the configured limitRemoteService::convertFileTopasses the configured timeout to the HTTP clientRemoteService::convertToaccepts a$timeoutparameter (defaults toREMOTE_TIMEOUT_DEFAULTfor non-preview callers)docs/app_settings.md