Skip to content

[Bug]: Metadata like Uploaded by and File Usage is not included in the final reason sent with deletion request #6355

@rohit9625

Description

@rohit9625

Summary

We can nominate images for deletion, either uploaded by us or others. However, we need to send a legitimate reason for deletion. Also, we are supposed to add Uploaded Date, Uploaded by, and File Usage in the final reason sent with the deletion request of our images. This was implemented in this PR #1824 in 2018.

Finding the file usages involves fetching data from the Commons API, which is a time-consuming task. But the result was not appended in the reason string before sending deletion requests, and fetching file usage became redundant in this case.

This issue should be focused on appending the metadata with the final reason and writing unit tests to prevent regressions in the future.
However, I also think we should consider appending similar metadata to the deletion requests made for others' contributions because we eventually call the getReason function and not using the result here:

val resultSingletext: Single<Boolean> = reasonBuilder.getReason(media, reason)
.flatMap { _ ->
deleteHelper.makeDeletion(
context, media, reason
)
}

I am also concerned with the reason template we have currently. This how it will look after above fix:

I uploaded it by mistakeUploaded by myself on Sep 16, 2024, used in 3 article(s) at least.

It can be improved based on suggestions. So, please give your valuable feedback :)

Some of the template alternatives are:

  • I uploaded it by mistake (uploaded on Sep 16, 2024, used in at least 3 article(s)).
  • I uploaded it by mistake [uploaded on Sep 16, 2024; used in ≥3 article(s)]
  • I uploaded it by mistake – uploaded on Sep 16, 2024, used in 3+ article(s).
  • I uploaded it by mistake: uploaded on Sep 16, 2024, used in at least 3 article(s).
  • Reason: I uploaded it by mistake; Uploaded: Sep 16, 2024; Used by: 3 article(s);

Steps to reproduce

  1. Open any of your contribution(Prefer which you want to delete)
  2. When navigated to the Media Details Screen, scroll down and click Nominate for Deletion
  3. Choose an appropriate reason for deletion (ed: Sorry this picture is not interesting for an encyclopedia)
  4. Wait for the request to complete
  5. Visit your uploaded image's page on the Commons Website (eg: image)
  6. You must see a dialog like this:
  1. Click on the nomination page

Expected behaviour

You should see your request for deletion with your chosen reason appended with metadata like this:
<Your reason>Uploaded on <date> and used in <no. of file usages> article(s).

Eg:

Sorry this picture is not interesting for an encyclopediaUploaded on 21 January 2024 and used in 1 article(s).

Actual behaviour

Only the exact reason is shown without any other information.

Device name

Samsung A14

Android version

Android 14

Commons app version

main-branch

Device logs

No response

Screen-shots

Current situation when we mark our image for deletion.

Would you like to work on the issue?

Yes

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions