Page MenuHomePhabricator

Images being added to the database multiple times
Open, MediumPublicBUG REPORT

Description

During the process of extracting all images for a campaign, we ignore categories that have already been seen, but do not ignore images that have already been seen.
The only way this error shows up at present is that the count of images is larger than it should be (in cases where duplicate images have been added). But obviously this also increases the load on the database.

Example:
For the following categories with depth=0

  • Turkey photographs taken on 2020-06-14
  • Taxis in Ankara

Petscan shows number of files in this combination of categories as 38 files in total, while ISA shows 39.
The extra one image is a duplicate, because there is one image which appears in both categories.

Event Timeline

NavinoEvans triaged this task as Medium priority.

This should be fixable by adding a check to see if the same image (same page_id and campaign_id) exists at https://gerrit.wikimedia.org/r/plugins/gitiles/labs/tools/Isa/+/refs/heads/master/isa/campaigns/image_updater.py#163.

You could even say that page ids are unique and have a many-to-many relationship between images and campaigns. I don't know exactly how to do this, but I know it's a thing you can do.

Juniorbesong changed the task status from Open to In Progress.Jan 21 2024, 1:04 AM

@Sebastian_Berlin-WMSE, @Eugene233, @NavinoEvans. I wish to suggest on checking if the same image (with the same page_id and campaign_id) exists. Then fetches all images in the given category and if, depth is more than 0, its subcategories filter out pages that do not match for images. What are your reviews?

.

Change 998432 had a related patch set uploaded (by Juniorbesong; author: Juniorbesong):

[labs/tools/Isa@main] BUG: T320500 modified isa/campaigns/image_updater.py

https://gerrit.wikimedia.org/r/998432

Aklapper changed the task status from In Progress to Open.Apr 11 2025, 10:20 PM
Aklapper subscribed.

Resetting task status from "In Progress" to "Open" as this task has been "in progress" for more than one year (see T380300). Feel free to set that status again, or rather break down into smaller subtasks.