Bug 875973 - Filter by content state with unsaved change may save twice
Summary: Filter by content state with unsaved change may save twice
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Zanata
Classification: Retired
Component: Component-Logic
Version: development
Hardware: Unspecified
OS: Unspecified
high
unspecified
Target Milestone: ---
: 2.0
Assignee: Patrick Huang
QA Contact: Ding-Yi Chen
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-11-13 00:29 UTC by Patrick Huang
Modified: 2013-02-26 03:46 UTC (History)
2 users (show)

Fixed In Version: 2.0.3-SNAPSHOT (20121127-0017)
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-02-26 03:46:29 UTC
Embargoed:


Attachments (Terms of Use)

Description Patrick Huang 2012-11-13 00:29:18 UTC
Description of problem:
When user has unsaved change in editor and check the filter by state checkbox, a pop up will be displayed and asking user to save or discard current change before continue the filtering. Depending on the timing, the filtering load may happen in the middle of the saving and cause another pending save. See below for more information.

Version-Release number of selected component (if applicable):
2.0-

How reproducible:
Depending on the event timing and ordering

Steps to Reproduce:
1. Go to translation editor and type something in one row with approved translation (row indicates unsaved)
2. Click on Message filters option on editor options panel and select Translated 
3. In the filter confirmation pop up, select save as fuzzy
4. If you are in slow network, the saving indicator will appear quite a while and during "saving", the filter may finish earlier than the save and therefore override current saving row with old value.
  
Actual results:
After filter reload, before reload current page it will try to re-select current row and sees that current row has unsaved change, it will trigger another pending save event and push into saving queue. Then reload the page and override value to old value. So what you see from translation history is:
one fuzzy save(triggered by filter confirmation pop up)
one approved save(triggered by implicit pending change save)
unsaved change(after reload page editor value gets set back to original)

Expected results:
The active row should be saved as fuzzy only.

Additional info:

Comment 1 Patrick Huang 2012-11-13 05:00:36 UTC
committed into release and master:
https://github.com/zanata/zanata/commit/6231a67a2d3738d73ffa9851a93fcae2559000fe

Comment 3 Ding-Yi Chen 2012-11-27 06:09:02 UTC
VERIFIED with Zanata version 2.0.3-SNAPSHOT (20121127-0017)
and Zanata version 2.1-SNAPSHOT (20121127-1134)


Note You need to log in before you can comment on or make changes to this bug.