Skip to content

Conversation

@Bugfire
Copy link
Contributor

@Bugfire Bugfire commented Jan 8, 2026

Hello!

Following the discussion in #451, I have submitted this PR to ensure consistent logging behavior during file uploads.

Problem:
Currently, when config.compression is 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.rb to 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):

AssetSync: Syncing.
Using: Directory Search of /repos/asset_sync_test/public/assets
Ignoring: assets/application-62814923c418882209e8243eee534d666011fe69fc61029bbdfd7d8c615949c3.css.gz
Ignoring: assets/application-ad189a8ed1b81e7d89926be999c39673926f839c8633a6e04c3f9f7d4c70dcd2.js.gz
Ignoring: assets/manifest-dad05bf766af0fe3d79dd746db3c1361c0583026cdf35d6a2921bccaea835331.js.gz
Uploading: assets/manifest-dad05bf766af0fe3d79dd746db3c1361c0583026cdf35d6a2921bccaea835331.js instead of /repos/asset_sync_test/public/assets/manifest-dad05bf766af0fe3d79dd746db3c1361c0583026cdf35d6a2921bccaea835331.js.gz (compression increases this file by 13.04%)
Uploading: /repos/asset_sync_test/public/assets/application-ad189a8ed1b81e7d89926be999c39673926f839c8633a6e04c3f9f7d4c70dcd2.js.gz in place of assets/application-ad189a8ed1b81e7d89926be999c39673926f839c8633a6e04c3f9f7d4c70dcd2.js saving 58.75%
Uploading: /repos/asset_sync_test/public/assets/application-62814923c418882209e8243eee534d666011fe69fc61029bbdfd7d8c615949c3.css.gz in place of assets/application-62814923c418882209e8243eee534d666011fe69fc61029bbdfd7d8c615949c3.css saving 63.95%
AssetSync: Done.

After (test_image.png is correctly logged):

AssetSync: Syncing.
Using: Directory Search of /repos/asset_sync_test/public/assets
Uploading: assets/test_image-6309c283288af83b5cc4b59a06d18fb630f3589c7e82c599c8d810511e1c6638.png
Ignoring: assets/manifest-dad05bf766af0fe3d79dd746db3c1361c0583026cdf35d6a2921bccaea835331.js.gz
Ignoring: assets/application-62814923c418882209e8243eee534d666011fe69fc61029bbdfd7d8c615949c3.css.gz
Ignoring: assets/application-ad189a8ed1b81e7d89926be999c39673926f839c8633a6e04c3f9f7d4c70dcd2.js.gz
Uploading: assets/manifest-dad05bf766af0fe3d79dd746db3c1361c0583026cdf35d6a2921bccaea835331.js instead of /repos/asset_sync_test/public/assets/manifest-dad05bf766af0fe3d79dd746db3c1361c0583026cdf35d6a2921bccaea835331.js.gz (compression increases this file by 13.04%)
Uploading:/repos/asset_sync_test/public/assets/application-62814923c418882209e8243eee534d666011fe69fc61029bbdfd7d8c615949c3.css.gz in place of assets/application-62814923c418882209e8243eee534d666011fe69fc61029bbdfd7d8c615949c3.css saving 63.95%
Uploading: /repos/asset_sync_test/public/assets/application-ad189a8ed1b81e7d89926be999c39673926f839c8633a6e04c3f9f7d4c70dcd2.js.gz in place of assets/application-ad189a8ed1b81e7d89926be999c39673926f839c8633a6e04c3f9f7d4c70dcd2.js saving 58.75%
AssetSync: Done.

Closes #451

Thank you for your review!

When compression is enabled but no compressed version exists for a file,
the upload was not being logged. This adds logging for visibility.
@PikachuEXE PikachuEXE merged commit 0689f64 into AssetSync:master Jan 9, 2026
31 checks passed
@PikachuEXE
Copy link
Member

Let me release after updating CI and any other stuff

@PikachuEXE
Copy link
Member

2.19.3 released (also fixed issue with ruby 4.0

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.

Missing upload log for uncompressed files when compression flag is enabled

2 participants