Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 472622

Summary: Popups and tooltips are showing multiple content
Product: [ECD] Orion Reporter: Michael Rennie <Michael_Rennie>
Component: ClientAssignee: Eric Moffatt <emoffatt>
Status: RESOLVED WORKSFORME QA Contact:
Severity: major    
Priority: P3 CC: curtis.windatt.public
Version: 9.0   
Target Milestone: 10.0   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on: 471976    
Bug Blocks:    
Attachments:
Description Flags
screen shot of assist hover multiples
none
Here's what I see for the two cases you mention none

Description Michael Rennie CLA 2015-07-14 10:29:00 EDT
Created attachment 255188 [details]
screen shot of assist hover multiples

Something has happened with the tooltips / popups, they are now showing old content when reopened, and multiples of it.

In the attached screen shot I activated HTML assist and started typing 'base' You can see the tooltip for the first entry in the template list, followed by 'b' followed by 'base'.
Comment 1 Michael Rennie CLA 2015-07-14 10:48:58 EDT
Looks like there is some weird caching going on in tooltip.js#_processInfo, then later in #_showContents we end up appending to the same cached version over and over again.
Comment 2 Curtis Windatt CLA 2015-07-14 11:08:01 EDT
Caused by Bug 471976.  The hide short circuits if you don't pass in the clearLock flag.  When mousing or keyboard updown in content assist the flag is passed, but when typing to filter CA, the code path is separate and the flag is not used.
Comment 3 Curtis Windatt CLA 2015-07-14 11:08:14 EDT
Tooltip.hide (tooltip.js:184)
objects.mixin.install._listener.onSelection (editor.js:856)
EventTarget._dispatchEvent (eventTarget.js:76)
EventTarget.dispatchEvent (eventTarget.js:62)
TextView.onSelection (textView.js:2776)
TextView._setSelection (textView.js:6914)
TextView._modifyContent (textView.js:6558)
TextView._doContent (textView.js:4874)
TextView._handleKeyPress (textView.js:3881)
TextView._hookEvents.handlers.push.handler (textView.js:6317)
Comment 4 Eric Moffatt CLA 2015-07-14 14:21:23 EDT
Yes, this is a strange one...the page tries to tear down the tooltip and fails but then we get another 'show' (without CA ever having called 'hide' with the 'clearLock' set I think).

In any case here's a 'fix' that ensures that the '_tooltipDiv' only ever contains a single '_tooltipContents':

http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=67f6b421f8df3a7ca6d0ae04e88d26db4c9b662b
Comment 5 Michael Rennie CLA 2015-07-15 15:07:54 EDT
(In reply to Eric Moffatt from comment #4)
> Yes, this is a strange one...the page tries to tear down the tooltip and
> fails but then we get another 'show' (without CA ever having called 'hide'
> with the 'clearLock' set I think).
> 
> In any case here's a 'fix' that ensures that the '_tooltipDiv' only ever
> contains a single '_tooltipContents':
> 
> http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/
> ?id=67f6b421f8df3a7ca6d0ae04e88d26db4c9b662b

something is still flakey here.

While testing the new version of Tern I could do the following:

/*eslint-env amqp*/
/**
 * @param {object} a
 * @param {type} b
 */
function f(a, b, c) {}
new Array().concat(new Array(1));

f();
a^

1. hover over f() -> see hover 'a function'
2. activate assist at ^ -> see first proposal with hover 'a function' 
3. mouse up/down it corrects

I think at this point if we can't properly fix this we should revert any commits prior to this problem. It gives the impression that the tools are not working, when in reality its just the tooltip code.
Comment 6 Eric Moffatt CLA 2015-07-16 10:57:55 EDT
Created attachment 255246 [details]
Here's what I see for the two cases you mention
Comment 7 Eric Moffatt CLA 2015-07-20 13:52:06 EDT
Mike mentioned that we really should have some unit tests for this. I'll look into how we might do this (special testing hover providers...).
Comment 8 Curtis Windatt CLA 2015-11-19 10:06:11 EST
We haven't seen any more duplicate issues since we added API to only update the div size without affecting contents. Recently in Bug 482522 we had duplicate contents because we weren't using this new API.  I'm closing this bug as WORKSFORME.  Mike, if you have seen any other duplicated tooltips please reopen.