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
Can't go past 54 units after going through critical checks and muting them #4983
Comments
One thing I noticed is that in XHR there is a pretty strange offset at step 6: |
From my experiments, this bug is 100% reproducible. I can never go past 54 units when muting checks. |
@iafan this is on a live site, do you have a staging site we can use? I can't seem to login to the EN staging instance. |
@dwaynebailey I recreated your admin user entrу on stage — do you remember your username/password? Go to https://translate.stage.evernote.com/projects/, log in, click the "Fix critical errors" link in the action toolbar, and go through 54 units, muting the check on each of them. |
@iafan managed to replicate. Will play a bit to see if there is a simpler way to replicate. Also noted that you can't unmute muted checks, not sure if that is related to this bug though. |
Indeed. Will you file a bug or should I do this? |
@iafan if you can validate please file bug. I wasn't 100% sure if I was seeing mirage or not. |
Ok, filed #5010 |
This might be related: while translating on MLO using the incomplete filter, I got stuck at 96/181 (I skipped some units manually in the process). Although now that I check the about page, it reports version 2.7.3b1, so I have no way to really confirm whether it's the same issue or not. |
@julen mlo is on master. The |
As a heads-up, I retried on the updated MLO the same what I did this morning and I could reproduce the issue again (stuck at 80/82). |
I think the bug is somewhere in this code (and in the approach behind it in general): https://github.com/translate/pootle/blob/master/pootle/apps/pootle_store/unit/search.py#L171-L179 Server tries to rely on an offset to the search results that can unpredictably change from one execution to another. This can possibly work only in the case of a stable set (no synchronization in background + only navigating through units without altering their state that would affect the filter + no one else editing these units). Any single step off that path, and you can get all sorts of odd behavior. The only reliable solution in addressing this that comes to my mind would be to keep the snapshot of uids on the client and not redo any search on requesting the new page of units. It would work as follows:
In addition to fixing the original problem, this approach has several advantages:
|
@iafan this is much like the model we moved away from for some very good technical reasons including that data "can unpredictably change from one execution to another" (search for untranslated units and suddenly you have a translated one that someone else visited), it was really expensive and killed users browsers. Choosing a bigger offset doesn't actually change this issue, you're still looking at potentially out of date data if the backend data changed while you were hanging around in your 1000 units. Starting from 1 assumes a certain type of dataset, I don't think any translator wants to revisit a few 100 units that they've already evaluated. The code already does some work to find out where the offset would restart while you were busy. The SQL queries are limited but still expensive and still not 100% correct over time. Smaller query sets are more correct over time as their footprint is just way smaller. Continuous scrolling is tangential to this issue as nothing in the current model would prevent that being implemented. My view is that a more correct model is to actually allow the units in the current offset to be updated when any changes happen on the server that might remove them from the dataset. That would allow the editor to safely remove them and adjust its expected offset. This coupled with the editor being able to request the next offset while busy with the last few units of the current offset would ensure a smooth transition from offset to offset and allow continuous scrolling to happen. |
Note that even if you request smaller chunks, you still get them from sorted sets, so DB has to sort the entire set of units just to return a few of them. And now you do this on each page load. Anyway, just wanted to provide my additional input based on the analysis of the code. The main takeaway here is that this doesn't seem to be a bug which is easy to fix; this requires significant change to the approach. I think we'll internally experiment with the approach I outlined above, and we'll pay attention to browser memory use. |
Just wanna raise that during the Paris hackathon I've hit this many times in MLO while going through units and editing them. |
This is reproducible with a test file of broken critical checks made up on N repeats of: msgid "One 55 %file"
msgstr "Een 55 %leêr " This has broken The results show some consistant patterns which I think are linked to the counts for the unit batches we are retrieving. I suspect this is an offset issue where muting checks is somehow not adjusting expectations, or over adjusting expectations. Just needed some pretty brutal clicky testing and a painfully consistent test file to replicate consistently. Personally I don't think its hard to fix once the pattern emerges. |
Small script I used to make a file to reproduce the bug. This is designed to have one critical check and one non-critical check. The number in the unit is designed to match the unit counts in the editor. The code below will produce 19 PO units, adjust the range to N+1 as needed for more units. # -*- coding: utf-8 -*-
from translate.storage import po
pofile = po.pofile()
for i in range(1, 20):
unit = pofile.addsourceunit("One %s %%file" % i)
unit.target = "Een %s %%leêr " % i
with open("54units.po", "w") as outfile:
pofile.serialize(outfile) |
Fixed in #5798 clicky test results have been updated to reflect the outcomes with the new changes. The issue was indeed offset and not methodology. Bottom line: reproducible test, JS debugging, a head to work through the offset issues and patience to clicky testing was what this bug actually needed to get itself fixed. |
I've got the same problem twice in a row. I'm on latest stable Windows / Chrome.
Here are the steps:
Javascript console shows no errors. This is the log of XHR requests:
https://translate.evernote.com/xhr/stats/checks/?path=%2Fprojects%2Fmac_v5_evernote%2F
https://translate.evernote.com/xhr/units/?path=%2Fprojects%2Fmac_v5_evernote%2F&category=critical&filter=checks
edit/
andtoggle/
requests for 18 unitshttps://translate.evernote.com/xhr/units/?path=%2Fprojects%2Fmac_v5_evernote%2F&category=critical&filter=checks&offset=18&previous_uids=3807041&previous_uids=4992561&previous_uids=3807045&previous_uids=4992562&previous_uids=3807047&previous_uids=3807048&previous_uids=4992563&previous_uids=3807050&previous_uids=3807051&previous_uids=4992564&previous_uids=3807053&previous_uids=3807054&previous_uids=4992565&previous_uids=3807056&previous_uids=3807057&previous_uids=3807058&previous_uids=3809590&previous_uids=4992593
edit/
andtoggle/
requests for 18 unitshttps://translate.evernote.com/xhr/units/?path=%2Fprojects%2Fmac_v5_evernote%2F&category=critical&filter=checks&offset=25&previous_uids=3809592&previous_uids=4992594&previous_uids=3809594&previous_uids=4992595&previous_uids=3809596&previous_uids=3809597&previous_uids=4992596&previous_uids=3809599&previous_uids=3809600&previous_uids=4992597&previous_uids=3809602&previous_uids=3809603&previous_uids=4992598&previous_uids=3809605&previous_uids=3809606&previous_uids=3809607&previous_uids=4992626&previous_uids=3812141
edit/
andtoggle/
requests for 18 unitsThat's all. There's no request for new units past the third page.
I still have the browser page open in this state, so if you want me to run some debug JS, let me know.
See also a totally unrelated bug: #4625
The text was updated successfully, but these errors were encountered: