Skip to content

[Bug]: Categories fail to load when search term is empty #6127

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
savsch opened this issue Jan 13, 2025 · 5 comments · Fixed by #6128
Closed

[Bug]: Categories fail to load when search term is empty #6127

savsch opened this issue Jan 13, 2025 · 5 comments · Fixed by #6128
Assignees
Labels

Comments

@savsch
Copy link
Contributor

savsch commented Jan 13, 2025

Summary

While uploading an image, when the categories screen is first loaded, the search term is empty. Thus, the following categories are supposed to be shown:

  • commons category of depicted item(s)
  • categories based on location
  • categories based on image title
  • recent categories

However, no categories are shown at all, when the search term is empty.

Steps to reproduce

  1. Initiate an upload
  2. On the depicts screen, select one or more items that have a commons category associated with them (e.g. insect).
  3. Press Next to go to the categories screen.

Expected behaviour

The categories associated with depicted item(s), and recent categories, and so on... are listed.

expected.mp4

Actual behaviour

No categories are listed.

actual.mp4

Device name

Samsung S20 FE

Android version

Andoid 13

Commons app version

5.0.2-debug-main~0e735512b (latest main)

Device logs

No response

Screen-shots

No response

Would you like to work on the issue?

Yes

@savsch savsch added the bug label Jan 13, 2025
@savsch
Copy link
Contributor Author

savsch commented Jan 13, 2025

The issue seems to be caused by a null pointer exception, and is present since 0e73551

it.uploadMediaDetails was [UploadMediaDetail(languageCode=en, descriptionText=null, captionText=null)] here when the npe occured.

This is strange because captionText is null. Replacing the above line with .map { it.uploadMediaDetails[0].captionText?:"" } fixes this issue, but has the obvious side-effect of image-title-related categories not being displayed.

@nicolas-raoul
Copy link
Member

Yes I have observed this issue very frequently recently, like 50% of uploads.

@nicolas-raoul
Copy link
Member

possibly related: #5910

@nicolas-raoul
Copy link
Member

Maybe 100% of the time actually.

@sivaraam
Copy link
Member

Maybe 100% of the time actually.

+1

I am observing this issue on main too. It basically does not seem to be showing categories at all even when searching for some text.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants