Skip to content

[structured-commons] Wrong thumbnails at the "depictions" step when uploading #3601

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
nicolas-raoul opened this issue Mar 30, 2020 · 14 comments · Fixed by #3696
Closed

[structured-commons] Wrong thumbnails at the "depictions" step when uploading #3601

nicolas-raoul opened this issue Mar 30, 2020 · 14 comments · Fixed by #3696

Comments

@nicolas-raoul
Copy link
Member

nicolas-raoul commented Mar 30, 2020

Steps to reproduce:

  1. Open "Explore"
  2. Tap the search icon
  3. Enter "rabbit"
  4. Tap "Items"
  5. Thumbnails are showing correctly in this activity, as you can see
  6. Now get back to the home of the app, ans tap the "+" to start uploading an image
  7. At the "depictions" step, type "rabbit"
  8. Problem: For the item "Rabbit (species of small mammals)", the thumbnail for "Rabbit (basketball player)" appears:

Screenshot_20200327-193013_Commons

Please fix it by looking at how it is done in the Explore activity. Factorize code if you can (that can be another pull request though).

@dafnith
Copy link

dafnith commented Mar 30, 2020

Hey, can I take this one?

@nicolas-raoul
Copy link
Member Author

@dafnith Yes sure :-)

@nicolas-raoul nicolas-raoul changed the title [structured-commons] Wrong thumbnails in "Explore" [structured-commons] Wrong thumbnails at the "depictions" step when uploading Mar 30, 2020
@nicolas-raoul
Copy link
Member Author

nicolas-raoul commented Apr 3, 2020

@dafnith Any progress on this? Have you managed to reproduce the issue? :-)

@dafnith
Copy link

dafnith commented Apr 4, 2020

@nicolas-raoul Yes I have managed to reproduce the issue. Actually it took me a while to built correctly the project but now everything is ok and I am working on the issue.

@dafnith
Copy link

dafnith commented Apr 5, 2020

hey @nicolas-raoul I think I may have misunderstood the problem here. When I type rabbit in step 2 of upload, for the item "Rabbit (species of small mammals)", various wrong thumbnails appears and not only the "Rabbit (basketball player)". I don't understand if the problem is specifically with the basketball player error or the fact that it doesn't show the right image for "Rabbit (species of small mammals)".

@nicolas-raoul
Copy link
Member Author

Rabbit is only an example :-)
You are right, most (maybe all?) thumbnails are erroneous.

@dafnith
Copy link

dafnith commented Apr 6, 2020

Thank you, I will check it out!

@macgills
Copy link
Contributor

@dafnith are you still working on this? I have availability currently if you are happy for me to take over

@dafnith
Copy link

dafnith commented Apr 21, 2020

@macgills I was working on this but I find it hard to solve it. You can take the issue and I will be happy to see the solution.

@nicolas-raoul
Copy link
Member Author

nicolas-raoul commented Apr 21, 2020 via email

@dafnith
Copy link

dafnith commented Apr 22, 2020

Here is the relative paths of some classes I investigated:

  • fr/free/nrw/commons/upload/depicts/DepictsPresenter.java
  • fr/free/nrw/commons/explore/depictions/SearchDepictionsFragmentPresenter.java

In the DepictsPresenter class I tried to change fetchThumbnailForEntityId() method to be the same as fetchThumbnailForEntityId() of class SearchDepictionsFragmentPresenter.
That didn't work for me.

Then by debugging the app I navigated in many classes that are used in order for the depictions to be fetched but I couldn't find the way that the query was sent to the provider.
I wanted to check if the query and the data returned were correct. I could not find where these steps occurred and this is were I got stuck.

I would be more than happy if anyone could explain this to me!

@macgills macgills assigned macgills and unassigned dafnith Apr 22, 2020
@macgills
Copy link
Contributor

I'll let you know when I understand it myself!

@macgills
Copy link
Contributor

@dafnith the problem was 2 essential points

1.The adapter was not using fresco properly
1.When we were fetching image urls we were relying on position in the adapter which is incredibly error prone as we cycle through many data sets while the user types out a phrase so it would set the image url for position 1 for "rab" to the item at position 1 for "rabbit" depending on the order of web requests which can never be relied upon

@dafnith
Copy link

dafnith commented Apr 22, 2020

Thank you for the explanation! 🙂

macgills added a commit that referenced this issue Apr 23, 2020
…when uploading - show selected depictions at the top - ensure updates to nearby places are reflected
macgills added a commit that referenced this issue Apr 23, 2020
…when uploading - don't set imageUrl when the url is none
macgills added a commit that referenced this issue Apr 23, 2020
macgills added a commit that referenced this issue Apr 23, 2020
macgills added a commit that referenced this issue Apr 23, 2020
…when uploading - fix erroneous cache access
neslihanturan pushed a commit that referenced this issue Apr 25, 2020
…when uploading (#3696)

* #3601 [structured-commons] Wrong thumbnails at the "depictions" step when uploading - fix imageview rendering code

* #3601 [structured-commons] Wrong thumbnails at the "depictions" step when uploading - show selected depictions at the top - ensure updates to nearby places are reflected

* #3601 [structured-commons] Wrong thumbnails at the "depictions" step when uploading - don't set imageUrl when the url is none

* #3601 [structured-commons] Wrong thumbnails at the "depictions" step when uploading - rewrite unit tests

* #3601 [structured-commons] Wrong thumbnails at the "depictions" step when uploading - minor cleanup

* #3601 [structured-commons] Wrong thumbnails at the "depictions" step when uploading - fix erroneous cache access
ashishkumar468 pushed a commit to ashishkumar468/apps-android-commons that referenced this issue Oct 10, 2020
…ions" step when uploading (commons-app#3696)

* commons-app#3601 [structured-commons] Wrong thumbnails at the "depictions" step when uploading - fix imageview rendering code

* commons-app#3601 [structured-commons] Wrong thumbnails at the "depictions" step when uploading - show selected depictions at the top - ensure updates to nearby places are reflected

* commons-app#3601 [structured-commons] Wrong thumbnails at the "depictions" step when uploading - don't set imageUrl when the url is none

* commons-app#3601 [structured-commons] Wrong thumbnails at the "depictions" step when uploading - rewrite unit tests

* commons-app#3601 [structured-commons] Wrong thumbnails at the "depictions" step when uploading - minor cleanup

* commons-app#3601 [structured-commons] Wrong thumbnails at the "depictions" step when uploading - fix erroneous cache access
ashishkumar468 pushed a commit to ashishkumar468/apps-android-commons that referenced this issue Oct 10, 2020
…ions" step when uploading (commons-app#3696)

* commons-app#3601 [structured-commons] Wrong thumbnails at the "depictions" step when uploading - fix imageview rendering code

* commons-app#3601 [structured-commons] Wrong thumbnails at the "depictions" step when uploading - show selected depictions at the top - ensure updates to nearby places are reflected

* commons-app#3601 [structured-commons] Wrong thumbnails at the "depictions" step when uploading - don't set imageUrl when the url is none

* commons-app#3601 [structured-commons] Wrong thumbnails at the "depictions" step when uploading - rewrite unit tests

* commons-app#3601 [structured-commons] Wrong thumbnails at the "depictions" step when uploading - minor cleanup

* commons-app#3601 [structured-commons] Wrong thumbnails at the "depictions" step when uploading - fix erroneous cache access
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants