| Summary: | Client error: TypeError while press key quickly | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [RT] RAP | Reporter: | Jacob He <lord_hzq> | ||||||||||
| Component: | RWT | Assignee: | Project Inbox <rap-inbox> | ||||||||||
| Status: | RESOLVED FIXED | QA Contact: | |||||||||||
| Severity: | normal | ||||||||||||
| Priority: | P2 | CC: | ivan, lord_hzq, rherrad, rsternberg, tbuschto | ||||||||||
| Version: | 2.1 | ||||||||||||
| Target Milestone: | 2.2 M3 | ||||||||||||
| Hardware: | PC | ||||||||||||
| OS: | Windows 7 | ||||||||||||
| Whiteboard: | sr212 | ||||||||||||
| Attachments: |
|
||||||||||||
In BasicText.js the _applyFocused method is called (newValue == false) on the Text control that is about to be disposed (has no parent anymore) when the new Text control gains the focus and tries to render the selection. The selection should probably only be rendred if the widget is focused, not blurred.
_applyFocused : function( newValue, oldValue ) {
this.base( arguments, newValue, oldValue );
if( !rwt.widgets.util.FocusHandler.mouseFocus ) {
this._renderSelection();
}
},
The bug affects not only Text widget, but also other widgets such as Button, Combo, List, etc. Is there any around way to make the application work before the bug is fixed? (In reply to Jacob He from comment #2) > The bug affects not only Text widget, but also other widgets such as Button, > Combo, List, etc. It affects Text widgets that are focused and disposed while any other widget gets focused. I can't think of a workaround right now, but If I'm correct about the issue the bug should be fixed in 2.2M3, 2.1.2, and in nightly builds relatively soon. Fixed with commit a218ce1dcb2e8c7910b1c1d8f19438f8547eb2a0 in master. Commit should be possible to apply to 2.1 branch without conflicts after review. Created attachment 236525 [details] target for bug 418719 validation Comment on attachment 236525 [details] target for bug 418719 validation I downloaded with the bug fix but it does not work version. validated test with the demo posted by He the error still exist Created attachment 236526 [details] error stii lexit for bug 418719 Are you using RAP nightly p2 repo - http://download.eclipse.org/rt/rap/nightly/runtime/? (In reply to Ivan Furnadjiev from comment #9) > Are you using RAP nightly p2 repo - > http://download.eclipse.org/rt/rap/nightly/runtime/? yes I use http://download.eclipse.org/rt/rap/nightly/runtime/? I noticed that to quickly press the page down key example does not crash the application. The bug occurs when i click for 2 or 3 continuous seconds. I attached the logs in the browser file navigator_log.txt Created attachment 236537 [details]
bug_418719 still occur with continous click on web page
OK... I will reopen the bug for further investigation. Stack trace suggests this is unrelated to the issue I fixed (i.e. there are two bugs in the code that can be triggered the same way.) The issue is KeyEventSupport.checkBufferedEvents - it attempts to send key events for widgets that are already disposed. Fix should be easy, though it would be preferrable to refactor this method completely to take advantage of the new OperationHandler. For 2.1.2 however we will just have to check for disposed widgets. Fixed in master with commit 43407ec12d41c7532bb8532e03ca4426fb330d74. The fix is not really obvious but after Ivan's explanations I'm convinced that it's good for 2.1.2. Backported commit 43407ec12d41c7532bb8532e03ca4426fb330d74 to 2.1-maintenance branch with change https://git.eclipse.org/r/21255 Backported commit a218ce1dcb2e8c7910b1c1d8f19438f8547eb2a0 to 2.1-maintenance branch with change https://git.eclipse.org/r/21310 |
Created attachment 236134 [details] Demo project to reproduce the bug. On RAP 2.1 application, I pressed keys quickly on page and "client error" occurred. In FF, error message is: TypeError: ObjectManager.getEntry(...) is undefined In IE, error message is: TypeError: Unable to get value of the property 'handler': object is null or undefined Stack trace shows the error occurs at rap-client.js line 71046. The method is rwt.remote.RemoteObjectFactory._initRemoteObject. Code is: var handler = ObjectManager.getEntry( id ).handler; The base idea of my application is: 1. use RWT.ACTIVE_KEYS to accept some shortcut key strike from web page; 2. the key strike will signal a back end thread to run some business logic; 3. the back end thread will update widgets on web page, like deleting old widgets, creating new widgets, updating exist widgets, etc. The attachment is a prototype project for such idea. The entry point of it is "/demo". After opening a new editor, just press one of following keys quickly enough, the client error will occur always. It has been tried on RAP 2.1 and 2.1.1. Keys: "ENTER", "BREAK", "PAGE_DOWN", "PAGE_UP", "F1", "F2", "F3", "F4", "F5", "F6", "F7", "F8", "F9", "F10", "F11", "F12", "SHIFT+F1", "SHIFT+F2", "SHIFT+F3", "SHIFT+F4", "SHIFT+F5", "SHIFT+F6", "SHIFT+F7", "SHIFT+F8", "SHIFT+F9", "SHIFT+F10", "SHIFT+F11", "SHIFT+F12"