Closed fluffy-critter closed 1 year ago
asset_path
can be None
(and usually is for actual images) so there's no way to put a uniqueness constraint on the index. It's unclear what sometimes causes the full path to be registered with the database. Perhaps a better fix would be to store asset paths in their own separate table.
Expected Behavior
Asset files should only ever be indexed with their canonical, relative path
Current Behavior
Sometimes an asset file gets reindexed with its full path, rather than its local-relative path, and this ends up causing multiple asset entries with the same identifier, which then results in an exception at retrieval time:
When the database is in this state it has duplicate asset entries e.g.:
Possible Solution
At the very least, the asset identifier needs to have a uniqueness constraint on its index. This will also help to track down how this full-path asset location is leaking into the content indexer in the first place.
Steps to Reproduce (for bugs)
1. 2. 3. 4.
Context