Bug 1220960

Summary: [GWT Editor] Logic errors in how TM results are coalesced.
Product: [Retired] Zanata Reporter: David Mason <damason>
Component: Component-Logic, TranslationEditorAssignee: Damian Jansen <djansen>
Status: CLOSED UPSTREAM QA Contact: Zanata-QA Mailling List <zanata-qa>
Severity: low Docs Contact:
Priority: unspecified    
Version: 3.7CC: zanata-bugs
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-07-29 03:28:50 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 2015-05-12 23:29:31 UTC
Description of problem:

In the code for translation memory search, multiple results that have the same source and translation text are combined into a single summary result.

Looking at the code where this happens (TranslationMemoryServiceImpl.addOrIncrementResultItem) it appears there are two problems:

 - result item is given the match type of whichever result appears first. The match type does not change even from 'translated' to 'approved', so the editor will always show the lower result type of 'translated'.

 - id for imported TM items is added to a list, which is later used to look up text flows. Since both use a Long type for the id, there is no error but it could return non-matching text flows that happen to have the same id as the imported TM item.

The ids are sent to the client by GetTransMemoryHandler, then the client returns them to GetTransMemoryDetailsHandler which uses them to look up text flows.


The DTOs should change to include all the match types that occur (rather than just a single match type), and the ID for imported TM items and text flows should be wrapped in distinct types so that GetTransMemoryDetailsHandler can treat each appropriately.

Comment 1 Zanata Migrator 2015-07-29 03:28:50 UTC
Migrated; check JIRA for bug status: http://zanata.atlassian.net/browse/ZNTA-286