Bug 734196

Summary: Roles: Accidentally double-clicking during user removal from roles view causes lag, throws error in logs
Product: Red Hat Satellite Reporter: Corey Welton <cwelton>
Component: WebUIAssignee: Eric Helms <ehelms>
Status: CLOSED CURRENTRELEASE QA Contact: Katello QA List <katello-qa-list>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.0.1CC: mmccune
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-08-22 17:54:11 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 747354    

Description Corey Welton 2011-08-29 17:31:27 UTC
Description of problem:
While in the Roles view, if user accidentally doubleclicks the "Remove" (or what becomes of it), there is a noticeable lag in the UI, and eventually an error is thrown in the background. 

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


How reproducible:
....usually?

Steps to Reproduce:
1.  Create a new user, "bobthebuilder"
2.  Create a new role, "bobville construction" and navigate to it.
3.  Go to the 'users' section within this role and "Add" the user 'bobthebuilder'.
4.  Click the 'Remove' button; notice the text changes ("Removing...") but remains a link. Click this text.

  
Actual results:
Significant lag in the UI
eventually an error is thrown in the rails console:

ActiveRecord::RecordInvalid (Validation failed: User id can only have one same role assigned):
  app/controllers/roles_controller.rb:112:in `update'
  lib/util/threadsession.rb:77:in `thread_locals'

Rendered /usr/lib/ruby/gems/1.8/gems/actionpack-3.0.5/lib/action_dispatch/middleware/templates/rescues/_trace.erb (1.2ms)
Rendered /usr/lib/ruby/gems/1.8/gems/actionpack-3.0.5/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (3825.4ms)
Rendered /usr/lib/ruby/gems/1.8/gems/actionpack-3.0.5/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb within rescues/layout (17093.8ms)


Expected results:
Should not be able to get the system in a state where one is attempting (accidentally) add/remove user multiple near-simultaneous times.
 
Probably should not be able to click on "Adding..." or "Removing..." -- hyperlink should be removed -- while the system is 'thinking'.

Additional info:

This might be reproducible with the Add/Adding... link as well, but i wasn't able to clearly repro it there.  I suspect that clicking and reclicking whatever link happens to be there (Add/Adding/Remove/Removing) will eventually trigger this too.

Comment 1 Eric Helms 2011-09-07 18:14:02 UTC
commit a0f3b02ba9f90c277dbb48bbadfa46b0ab34e336

Great catch on the Adding and Removing still being a clickable link.  This commit should still show the Adding/Removing but disable the button while the action is occurring.  The Addind/Removing text should appear slightly faded to indicate the disabled nature.

Comment 2 Corey Welton 2011-09-22 15:08:12 UTC
QA Verified.

Comment 5 Mike McCune 2013-08-16 18:12:40 UTC
getting rid of 6.0.0 version since that doesn't exist