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

Bug 476961

Summary: [DnD] Drag and drop with UI feedback can crash the client
Product: [RT] RAP Reporter: Martin Domig <martin>
Component: RWTAssignee: Project Inbox <rap-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P2    
Version: 3.0   
Target Milestone: 3.1 M3   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Animated GIF showing how to crash the client
none
Simple patch to fix the client crash
none
Demo bundle with second table view to reproduce the bug
none
Animated GIF demonstrating the crash on the demo project none

Description Martin Domig CLA 2015-09-09 08:39:48 EDT
Created attachment 256460 [details]
Animated GIF showing how to crash the client

We have a number of tables with DnD support, you can drag table items from one table into an other. The DropTargetListener we use adds DND.FEEDBACK_INSERT_BEFORE to the event.

With RAP 3.0, when dragging a table item from one table into an other, the client can crash with a "null is not an object" javascript error message. Complete error stack see below.

I'll attach an animated GIF to demonstrate (watch closely just before the crash) and a proposed fix.
Comment 2 Martin Domig CLA 2015-09-09 08:44:40 EDT
Created attachment 256461 [details]
Simple patch to fix the client crash
Comment 3 Ivan Furnadjiev CLA 2015-09-09 09:29:15 EDT
Could you please provide this fix through Gerrit?

[1] https://wiki.eclipse.org/RAP/Git
Comment 4 Ivan Furnadjiev CLA 2015-09-10 04:44:58 EDT
Martin, I can't reproduce it with our Controls Demo. Which browser are you using? Could you please provide a simple snippet/entry point that demonstrate the issue? I'm interesting why node is null and how this is possible.
Comment 5 Martin Domig CLA 2015-09-10 12:22:55 EDT
Created attachment 256493 [details]
Demo bundle with second table view to reproduce the bug

Reproduced it on the attached demo bundle.

I've added a second table view with no elements to the default perspective and added DnD support to both of them. Start it up, open both table views and start dragging items into the empty table.

Takes a couple of times to trigger the bug. I don't know what exactly it depends on (network latency?), our live application crashes quite reliably after 2-3 attempts, sometimes on the first. I know this is not as simple as it could be since triggering the bugt is a bit of a PITA, but its what I could throw together in a hurry :)

Doesn't seem to be a browser issue, since I could reproduce it on
* Safari 8.0.8
* Chrome 45.0.2454.85 (64-bit)
* Firefox 40.0.3
...all running on my Mac.
Bug also appears on Internet Explorer 11 and Chrome running on Windows.
Comment 6 Martin Domig CLA 2015-09-10 12:23:53 EDT
Created attachment 256494 [details]
Animated GIF demonstrating the crash on the demo project

Takes a while, quite boring to watch until... boom.

The error message:

Error: TypeError: node is null

  Stack: .members._getRowLocation@http://localhost:9090/rwt-resources/rap-client.js:47142:9
.members._renderFeedbackBefore@http://localhost:9090/rwt-resources/rap-client.js:47098:24
.members._renderFeedback@http://localhost:9090/rwt-resources/rap-client.js:47076:11
.members.renderFeedback@http://localhost:9090/rwt-resources/rap-client.js:47056:7
rwt.remote.DNDSupport.prototype._renderFeedback@http://localhost:9090/rwt-resources/rap-client.js:43993:7
rwt.remote.DNDSupport.prototype.setCurrentTargetElement@http://localhost:9090/rwt-resources/rap-client.js:44080:5
rwt.remote.DNDSupport.prototype._onMouseOver@http://localhost:9090/rwt-resources/rap-client.js:44071:9
.members._dispatchEvent@http://localhost:9090/rwt-resources/rap-client.js:3865:13
.members.dispatchEvent@http://localhost:9090/rwt-resources/rap-client.js:3806:7
rwt.event.EventHandler._dispatchMouseEvent@http://localhost:9090/rwt-resources/rap-client.js:15503:7
rwt.event.EventHandler._fireElementHoverEvents@http://localhost:9090/rwt-resources/rap-client.js:15492:7
rwt.event.EventHandler._onmouseevent_post@http://localhost:9090/rwt-resources/rap-client.js:15430:1
rwt.event.EventHandler._processMouseEvent@http://localhost:9090/rwt-resources/rap-client.js:15402:5
rwt.event.EventHandler._onmouseevent@http://localhost:9090/rwt-resources/rap-client.js:15379:9
.bind/<@http://localhost:9090/rwt-resources/rap-client.js:624:14

  Debug: on
Comment 7 Ivan Furnadjiev CLA 2015-09-11 06:41:16 EDT
Thanks for the demo project. I can reproduce the issue now and I'm looking for the real reason.
Comment 8 Ivan Furnadjiev CLA 2015-10-27 09:57:39 EDT
Fixed with change https://git.eclipse.org/r/#/c/58919/