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

Number of strings changes when changing ordering #5105

Open
tomkolp opened this issue Dec 27, 2020 · 4 comments
Open

Number of strings changes when changing ordering #5105

tomkolp opened this issue Dec 27, 2020 · 4 comments
Labels
enhancement Adding or requesting a new feature.

Comments

@tomkolp
Copy link
Contributor

tomkolp commented Dec 27, 2020

Describe the bug

Incorrect number of empty strings after using the "Number of words" sort.

To Reproduce the bug

Description should look similar to this:

Steps to reproduce the behavior:

  1. Go to 'Hosted Weblate -> Documentation->Polish
  2. Click "Not translated strings" (4,406 strings)
  3. Sort by "Number of words" (the total number of strings increases from 4,406 to 4,564)

Screenshots
Screenshot_20201227-150151
Screenshot_20201227-150134
Screenshot_20201227-150121

@nijel
Copy link
Member

nijel commented Dec 27, 2020

I can't reproduce it - it still shows same number. What might have happened: The search result is cached in session for a user to give consistent results while he is changing the strings (otherwise translated strings would disappear from the search). Changing the sort order stops using the cache and fetches the data from the database. Not sure if we can do something effective to address this.

@nijel nijel added the enhancement Adding or requesting a new feature. label Dec 27, 2020
@tomkolp
Copy link
Contributor Author

tomkolp commented Dec 27, 2020

I can't reproduce it - it still shows same number. What might have happened: The search result is cached in session for a user to give consistent results while he is changing the strings (otherwise translated strings would disappear from the search). Changing the sort order stops using the cache and fetches the data from the database. Not sure if we can do something effective to address this.

Mobile version, android 9, I haven't tried for pc.

@tomkolp
Copy link
Contributor Author

tomkolp commented Dec 30, 2020

The problem occurs after translating several segments. You have to translate a few segments, stop the translation and come back to it. After sort change, the initial (greater than current) number of segments is loaded. It looks like it's reading from the cache. After a few hours, the number of segments is up-to-date.
The problem occurs on both the desktop computer and the phone.

@nijel
Copy link
Member

nijel commented Dec 30, 2020

That's the issue I've described in #5105 (comment). The list of matching strings is fetched first time the query (including ordering) is used. You then browse the cached result to be able to go to previous strings which might no longer match the conditions. The solution might be to reuse the existing cached string list when changing ordering.

@nijel nijel changed the title Incorrect number of empty strings Number of strings changes when changing ordering Jan 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Adding or requesting a new feature.
Projects
None yet
Development

No branches or pull requests

2 participants