Improvement: Ensure "Uploading" logs are output when compression is enabled #452
+2
−0
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.
Hello!
Following the discussion in #451, I have submitted this PR to ensure consistent logging behavior during file uploads.
Problem:
Currently, when
config.compressionis enabled, files that do not have a corresponding compressed version (such as PNG files) are uploaded without any log output. This makes it difficult to track the upload progress in the logs.Changes:
I have added an else clause to the compression logic in
lib/asset_sync/storage.rbto ensure that log "Uploading: #{f}" is called for files that are being uploaded, maintaining consistency with the non-compression workflow.As we discussed, I have been using this fix as a monkey patch in my test environment (https://github.com/Bugfire/asset_sync_test), and it is working perfectly.
Verification:
I have verified the fix by comparing the logs before and after the change.
Before (test_image.png is missing from the logs):
After (test_image.png is correctly logged):
Closes #451
Thank you for your review!