Skip to content
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

Fix: do not make an API call for an empty list in getPagesForLanguageVariant() #4950

Merged
merged 2 commits into from
Sep 11, 2024

Conversation

cooltey
Copy link
Collaborator

@cooltey cooltey commented Sep 11, 2024

What does this do?

If the list is empty, it will still return an empty string from the joinToString() method, which will cause an error when requesting the wikidata API call in L10nUtil.getPagesForLanguageVariant().

Why is this needed?

If the morelike: API returns an empty result, it is not necessary to go through the getPagesForLanguageVariant process.

@cooltey cooltey added Minor Minor stuff High Priority Priority code review needed labels Sep 11, 2024
@cooltey cooltey requested a review from dbrant as a code owner September 11, 2024 22:55
@dbrant dbrant merged commit 313f375 into main Sep 11, 2024
1 check passed
@dbrant dbrant deleted the fix-empty-list branch September 11, 2024 23:30
dbrant pushed a commit that referenced this pull request Sep 12, 2024
…Variant() (#4950)

* Fix: do not make an API call for an empty list in
getPagesForLanguageVariant()

* Improve performance
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
High Priority Priority code review needed Minor Minor stuff
Development

Successfully merging this pull request may close these issues.

2 participants