You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have already opened the issue carrierwaveuploader/carrierwave-mongoid#205 where I explain that when deleting a model which has a mounter using the :grid_fs storage engine, the GridFs::File is well destroyed, but the belonging GridFs::Chunk aren't, even do I found the has_many :chunks, ..., dependent: :destroy, ... line in this gem.
I have checked the tests from this gem and I couldn't find one which ensures the chunks are cleaned.
Added a direct GridFS regression in #89: destroying a reloaded file containing multiple chunks removes its file record and all its chunks, while preserving another file and its chunks. This passes on Mongoid 9. The existing dependent-destroy association works in that scenario, so this does not yet reproduce the CarrierWave integration failure.
file.delete, delete_all, and direct collection deletion skip dependent destruction; file.destroy, GridFs.delete(id), and namespace clear use destruction. Keeping this open pending a reproducible CarrierWave case and the supported-version CI results rather than claiming a fix from a passing direct test.
Activity
dblock commentedon Oct 18, 2026
Added a direct GridFS regression in #89: destroying a reloaded file containing multiple chunks removes its file record and all its chunks, while preserving another file and its chunks. This passes on Mongoid 9. The existing dependent-destroy association works in that scenario, so this does not yet reproduce the CarrierWave integration failure.
file.delete,delete_all, and direct collection deletion skip dependent destruction;file.destroy,GridFs.delete(id), and namespaceclearuse destruction. Keeping this open pending a reproducible CarrierWave case and the supported-version CI results rather than claiming a fix from a passing direct test.Posted by an AI on behalf of @dblock.
Expose GridFS queries and document storage configuration
Expose GridFS queries and document storage configuration
Expose GridFS queries and document storage configuration