Bug 826772

Summary: Project-wide Search returns wrong results in some cases
Product: [Retired] Zanata Reporter: Carlos Munoz <camunoz>
Component: Component-UIAssignee: David Mason <damason>
Status: CLOSED CURRENTRELEASE QA Contact: Ding-Yi Chen <dchen>
Severity: medium Docs Contact:
Priority: medium    
Version: 1.6-SNAPSHOTCC: sflaniga, zanata-bugs
Target Milestone: ---   
Target Release: 1.6.1   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 1.6.1-SNAPSHOT Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-07-03 05:27:42 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 Carlos Munoz 2012-05-30 23:18:47 UTC
Description of problem:
Project wide search might return incorrect results in some cases. Looks like it's a timing issue with two events being fired near simultaneously.


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


How reproducible:
Sometimes. Seems to be related to how fast the "case sensitive" checkbox is clicked.


Steps to Reproduce:
1. Go to search and replace for any project.
2. Do a case insensitive search for any word.
3. Change the case of a few letters in the search term and immediately click the "case sesitive" checkbox.
  
Actual results:
The included results are case insensitive.


Expected results:
Only case sensitive results should be included.

Comment 1 David Mason 2012-05-30 23:34:22 UTC
This is caused by a race condition between the blur event on the search text box and the check event on the checkbox.

Possible solutions:
 - provide an explicit 'search' button and don't run searches until it is clicked
 - check for new text in search box before firing a search on case sensitivity change.

Comment 2 David Mason 2012-06-05 08:09:16 UTC
Fixed in 1.6.1 by adding an explicit 'Search' button removing the automatic search update. A new search will now only run when the 'Search' button is pressed, or when Enter is pressed while the search text box has focus.

See https://github.com/zanata/zanata/commit/74da4821be2a5154255073556a64fcfcf2f0affa

Comment 3 Ding-Yi Chen 2012-06-07 04:59:43 UTC
Verified with Zanata version 1.6.1-SNAPSHOT (20120606-0019)