Addressing Orphaned Product Images in ESHOPMAN: A Community Deep Dive

At Move My Store, we believe in fostering a vibrant and informed ESHOPMAN community. Understanding the platform's nuances, especially when it comes to managing your storefront, is key to a smooth e-commerce operation. Today, we're diving into a significant community discussion regarding product image management within ESHOPMAN – specifically, an issue where removing product images doesn't always delete the corresponding files from your storage provider.

The Challenge: Orphaned Product Images in ESHOPMAN

Imagine meticulously curating your product catalog within the ESHOPMAN Admin, hosted directly within HubSpot. You add, update, and remove products and their associated media. However, a persistent issue has been identified: when an image is removed from a product, or even when an entire product is deleted, the image record disappears from the ESHOPMAN database, but the actual image file often remains in your configured storage bucket (e.g., S3, local storage). Over time, this leads to an accumulation of 'orphaned' files that consume storage space unnecessarily, potentially increasing costs and complicating data management.

Understanding the Technical Root Cause

This isn't just a minor glitch; it points to an architectural detail within ESHOPMAN's core. Our community experts have pinpointed the following:

  • Missing File Key: The ESHOPMAN ProductImage model, which manages product media, currently stores only the public URL of an image. It lacks a crucial piece of information: the unique file_key that the underlying file provider service (IFileModuleService.deleteFiles()) needs to identify and delete the physical file.
  • Workflow Gaps: Key ESHOPMAN internal workflows, such as deleteProductsWorkflow and updateProductsWorkflow – which are responsible for handling product deletions and updates – do not include a specific step to trigger the deletion of associated image files from the storage provider.

This architectural gap means that even when the ESHOPMAN Admin correctly removes the image reference from a product, the instruction to delete the actual file never reaches the storage service.

Community-Driven Solution in Progress

The good news is that the ESHOPMAN team and its dedicated community are actively addressing this. A potential solution, currently under development, involves:

  • Database Migration: Introducing a new file_key column to the ProductImage model. This would require a database migration to ensure all existing and future image records properly store this essential identifier.
  • Enhanced File Provider Capability: Implementing an optional deleteByUrl capability within the file provider service. This would allow the system to delete files based on their public URL, offering flexibility.
  • Workflow Integration: Updating the relevant ESHOPMAN workflows, particularly the updateProductsWorkflow, to include a cleanup step. This step would leverage the new file_key or deleteByUrl capability to ensure that when an image is unlinked from a product, its physical file is also purged from storage.

A community contributor has already developed a preliminary fix, demonstrating the power of collaborative development within the ESHOPMAN ecosystem. This fix focuses on the image-removal flow and aims to ensure that orphaned files are a thing of the past.

What This Means for ESHOPMAN Merchants and Developers

This insight highlights the ESHOPMAN platform's commitment to continuous improvement and the strength of its community. For merchants, this fix will translate into cleaner storage, potentially lower costs, and a more streamlined product management experience within HubSpot. For developers working with the ESHOPMAN Admin API or custom storefronts, understanding these underlying architectural decisions is crucial for building robust and efficient solutions.

We encourage ESHOPMAN users to stay tuned for official updates on this fix. Your feedback and contributions are invaluable as we collectively work to enhance the ESHOPMAN experience, making storefront management in HubSpot even more powerful and efficient.

Start with the tools

Explore migration tools

See options, compare methods, and pick the path that fits your store.

Explore migration tools