Bug 958350

Summary: Concurrent save on different row causes incorrect validation warnings in current row.
Product: [Retired] Zanata Reporter: David Mason <damason>
Component: Component-UIAssignee: David Mason <damason>
Status: CLOSED CURRENTRELEASE QA Contact: Ding-Yi Chen <dchen>
Severity: high Docs Contact:
Priority: unspecified    
Version: 2.3CC: zanata-bugs
Target Milestone: ---   
Target Release: 2.3   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 2.3.2-SNAPSHOT (20130506-1140) Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-11-27 03:23:15 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description David Mason 2013-05-01 03:13:08 UTC
Description of problem:
When in the editor, if a different row on the same page has a translation saved in another tab, the currently enabled validations are run on the updated translation and warnings are incorrectly applied to the currently selected row instead of the changed row.
Warnings remain on the row even when moving away, but are cleared when selecting the row that has the wrong warnings showing.
This does not happen when rows on a different page are changed.
This will happen regardless whether it is the same user or a different user making the change.

Version-Release number of selected component (if applicable):
version 3.0.0-SNAPSHOT (20130501-1233)
This is equivalent to 2.3 Release at the time of testing.

How reproducible:
Always

Steps to Reproduce:
1. Sign in and open a document with multiple pages of strings in the editor (tabA). Make sure some validators are active.
2. Open the same URL in a new browser window or tab (tabB)
3. In tabA, select a row that has no validation warnings
4. In tabB, select a different row on the same page and enter some text that causes validation warnings (try adding newlines, %x, {x}). Save the text.

Actual results:
In tabA, validations are displayed on the row that should not have any validation warnings.

Expected results:
The new validation warnings are shown on the row that was updated, not on the currently selected row.

Additional info:

Comment 1 David Mason 2013-05-02 03:53:03 UTC
It turns out the updated target is being validated against the currently selected source. This means that step 4. should be:

4. In tabB, select a different row on the same page and enter some text that would cause validation warnings if it were entered in the row that is selected in tabA.


e.g. if tabA has a row selected with source "Hello World" and tabB has a row selected with source "Hello {name}", and the translation "Hi {name} is saved in tabB, no warning is shown in tabB, but in tabA a warning will be shown about unexpected variable '{name}'.

Comment 2 David Mason 2013-05-02 08:01:30 UTC
Replaced code that assumed validation would always be for the current row. Warnings for concurrently updated translations should now show on the correct row.

See: https://github.com/zanata/zanata/commit/6e6f68d5c3447d5ec4d00b08af8aa7188e7b4496

Comment 3 Ding-Yi Chen 2013-05-06 02:24:24 UTC
VERIFIED with Zanata version 2.3.2-SNAPSHOT (20130506-1140) and 
Zanata version 3.0.0-SNAPSHOT (20130505-1232)

Comment 4 Sean Flanigan 2013-11-27 03:13:19 UTC
Closing VERIFIED bugs for Zanata versions <= 3.1.

Comment 5 Sean Flanigan 2013-11-27 03:15:23 UTC
Closing VERIFIED bugs for Zanata versions <= 3.1.

Comment 6 Sean Flanigan 2013-11-27 03:18:36 UTC
Closing VERIFIED bugs for Zanata versions <= 3.1.

Comment 7 Sean Flanigan 2013-11-27 03:23:15 UTC
Closing VERIFIED bugs for Zanata versions <= 3.1.

Comment 8 Sean Flanigan 2013-11-27 03:33:16 UTC
Closing VERIFIED bugs for Zanata versions <= 3.1.

Comment 9 Sean Flanigan 2013-11-27 03:35:32 UTC
Closing VERIFIED bugs for Zanata versions <= 3.1.