Red Hat Bugzilla – Bug 1064737
Statistics on locale documents page are incorrect (inconsistent with project version and editor)
Last modified: 2014-03-20 01:47:25 EDT
Description of problem:
We found that total number of messages of same number might be shown differently in GWT and JSF.
We found that in GWT, the total number of messages in that document is 450.
However, in JSF, the total number of messages in that document is 422.
Version-Release number of selected component (if applicable):
Also in Zanata 3.3.0-SNAPSHOT (20140213-0020)
Steps to Reproduce:
1. Visit document
2. Go to GWT document list, hover on the document name "LocalizedEnums"
The total messages here is 450.
3. Click the breadcomb "master", then click the document icon in "de" locale.
4. Switch the statistic to show "Messages"
5. Hover on the document name "LocalizedEnums", the total messages here is 424.
Total messages number in GWT (450) is different with the one in JSF (412).
Total messages number in GWT is the same with the one in JSF.
The problem can be seen by comparing the JSF pages, without having to look at the GWT editor. Just add up the stats on the JSF documents page for one of the locales (apparently wrong) and compare to the project version page's stats for that locale (apparently correct).
The stats on the project version page agree with the project group page and with the editor's doclist stats, and the total number of textflows in a document there agrees with the database.
Both pages uses different method on constructing the statistic,
editor uses : StatisticServiceImpl.getDocStatistics(Long documentId, LocaleId localeId)
jsf uses: StatisticServiceImpl.getStatistics(String projectSlug, String iterationSlug, String docId, boolean includeWordStats, String locales)
StatisticServiceImpl.getStatistics(String projectSlug, String iterationSlug, String docId, boolean includeWordStats, String locales) [currently broken] should call
StatisticServiceImpl.getDocStatistics(Long documentId, LocaleId localeId) [working].
The difference between these 2 are the single sql query on multiple locales which perform better compare to looping through StatisticServiceImpl.getDocStatistics(Long documentId, LocaleId localeId).
Ah okay, we should revisit it later then, whilst doing what we can to share logic between the two cases. But in the meantime, accuracy trumps performance.
Wait, what's the use case for fetching all the locale stats for a single document? Where do we show that?
Multiple locales options are only used in client - statistics command
VERIFIED with Zanata 3.3.0-SNAPSHOT (20140217-1515)
Just to clarify, with this bug:
- the locale documents page (JSF) had the wrong statistics
- the project version page (JSF) and the editor doclist (GWT) had the correct statistics
The locale documents page has been corrected so that its statistics now agree with the other two pages.
Closing VERIFIED bugs for Zanata server 3.3.2.