Page MenuHomePhabricator

Some sections are missed while processing saving queue
Closed, ResolvedPublic

Description

When testing progress calculation in T162113, I opened some mid-sized page and started clicking on "Add translation" placeholders.

After doing that for approx. half of the page, I returned to the dashboard to see the progress bar, since that bar was removed from translation view in CX2. Opening same translation after that reveals to me that some 4-5 sections are missing completely.

I suspect the problem occurs when you add translation while saving is still in progress. That is even bigger problem on slow connections.
Same problem was solved for target title and categories.

There is one report about the problem that I found with a quick search, there might be more.

Event Timeline

Petar.petkovic moved this task from Needs Triage to Bugs on the ContentTranslation board.

No, these aren't related. After further testing, I can confirm the problem is when you translate while saving is still in progress.

Change 447106 had a related patch set uploaded (by Petar.petkovic; owner: Petar.petkovic):
[mediawiki/extensions/ContentTranslation@master] Don't miss sections which are edited during saving

https://gerrit.wikimedia.org/r/447106

Change 447106 merged by jenkins-bot:
[mediawiki/extensions/ContentTranslation@master] Don't miss sections which are edited during saving

https://gerrit.wikimedia.org/r/447106

Petar.petkovic renamed this task from Section saving can fail to Some sections are missed while processing saving queue.Jul 23 2018, 9:23 AM
Petar.petkovic removed a project: Patch-For-Review.
Petar.petkovic moved this task from In Review to QA on the Language-2018-July-September board.

@Petar.petkovic - I do not think that the fix covers all the cases. If a user translates a paragraph (clicks on 'Add translation') after 'Saved just now' is displayed and immediately navigates away - the last translated paragraph(s) will not be saved. I did not see a significant loss of content (like 4-5 sections reported in the ticket), but one paragraph or a section title will be missing for sure. There is a noticeable delay from switching from 'Saved just now' to 'Saving...' (about 8s on a fast connection). Users might easily assume that 'Saved just now' meaning that all is saved and navigate away loosing their work.

Just a suggestion: Probably there should be an additional 'Saving...' display if a user clicks to navigate away?

@Petar.petkovic - I do not think that the fix covers all the cases. If a user translates a paragraph (clicks on 'Add translation') after 'Saved just now' is displayed and immediately navigates away - the last translated paragraph(s) will not be saved. I did not see a significant loss of content (like 4-5 sections reported in the ticket), but one paragraph or a section title will be missing for sure. There is a noticeable delay from switching from 'Saved just now' to 'Saving...' (about 8s on a fast connection). Users might easily assume that 'Saved just now' meaning that all is saved and navigate away loosing their work.
Just a suggestion: Probably there should be an additional 'Saving...' display if a user clicks to navigate away?

What you're describing is the issue that does exist, but is different from what this ticket wanted to capture. CX1 auto-saves the content if you navigate away with unsaved changes and we miss that functionality in CX2. We need a ticket for that.

We have saving queue that is processed every 15 seconds, if nothing goes wrong. Changed sections are added to that queue and processed when 15 seconds elapse. What used to happen previously is that we unconditionally reset the saving queue upon successful save, which can miss the sections added to the queue while the save request is being processed. That save request can take significant time if there are lots of content that got changed (say you translated big table) or connection is slow. So, if you keep adding sections while save request is processed, newly added sections will be just erased from the queue when previous request finishes successfully.

If you have some local setup, check out the parent commit of the one that fixes this (56d08c436cb75341fb4740d7e41fd09bcf790f56^) and click fast on "Add translation" placeholders while "Saving..." is displayed. Wait for saving to finish and go back to the dashboard. Opening the same translation again will show where the problem was. Lots of sections are likely to be missing.

@Petar.petkovic - I do not think that the fix covers all the cases. If a user translates a paragraph (clicks on 'Add translation') after 'Saved just now' is displayed and immediately navigates away - the last translated paragraph(s) will not be saved. I did not see a significant loss of content (like 4-5 sections reported in the ticket), but one paragraph or a section title will be missing for sure. There is a noticeable delay from switching from 'Saved just now' to 'Saving...' (about 8s on a fast connection). Users might easily assume that 'Saved just now' meaning that all is saved and navigate away loosing their work.
Just a suggestion: Probably there should be an additional 'Saving...' display if a user clicks to navigate away?

What you're describing is the issue that does exist, but is different from what this ticket wanted to capture. CX1 auto-saves the content if you navigate away with unsaved changes and we miss that functionality in CX2. We need a ticket for that.

I tried to add a paragraph and go back to the translation dashboard (clicking on "< All translations") and I got the expected dialog:

What seems to be missing is supporting the same behaviour when using the browser back button (which CX1 does, but CX2 does not). I created a ticket for that (T200502), feel free to add further details.

Etonkovidova closed this task as Resolved.Jul 28 2018, 12:08 AM

Thx, @Petar.petkovic - yes, the issue with missing translated content while 'Saving...' seems to be fixed.

CX1 auto-saves the content if you navigate away with unsaved changes and we miss that functionality in CX2. We need a ticket for that.

Yes, auto-save works perfectly in cx1, but not in cx2. Filed it as T200592: CX2 - auto-save does not work if user navigates away