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

Bug 513110

Summary: Better handle rapidly received *Changed events
Product: [ECD] Orion Reporter: Michael Rennie <Michael_Rennie>
Component: JS ToolsAssignee: Michael Rennie <Michael_Rennie>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P1 CC: curtis.windatt.public, libingw, steve_northover
Version: 13.0Flags: curtis.windatt.public: review+
steve_northover: review+
libingw: review+
Target Milestone: 14.0   
Hardware: PC   
OS: Mac OS X   
Whiteboard:

Description Michael Rennie CLA 2017-03-04 12:18:58 EST
Found in bug 512996 - the JS tools needs a bit better synchronization when handling rapid, successive changed events. The Tern demo widget is a good test for this, because as it is setting up it sends a bunch of inputChanged events in a way that does not happen in the normal web IDE.
Comment 1 Michael Rennie CLA 2017-03-06 10:15:39 EST
Pushed fix to:

http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=33ceb784df6bc0bb07c69202f7482085cec942e6

Curtis, Steve, et. al. please verify.
Comment 2 libing wang CLA 2017-03-06 13:36:28 EST
I've downloaded the latest build that has Michael's fix. The demo page now works like a  charm, without changing any demo page code.
Comment 3 Steve Northover CLA 2017-03-06 13:54:01 EST
I approve of making the fix but did not review the code.
Comment 4 Michael Rennie CLA 2017-03-06 14:59:12 EST
I pushed in a follow-up fix, that addresses two more sync'ing issues:

1. if you make many edits to important files and rapidly change to a JS file, the linting managed to happen before the env was ready

2. using the Show Problems command, we were not correctly honouring the env settings as the context switched.

http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=0507c6e39776353eada849eb6e0ce66b0d4d4df6
Comment 5 Curtis Windatt CLA 2017-03-06 17:13:09 EST
I tried a number of scenarios involving editing/deleting files and navigating, I did not have any issues with the linting not knowing the environment. so +1 from me. Tomorrow I'll see if I can break it by inserting waits, but looking at the Deferred logic it should always wait.
Comment 6 Michael Rennie CLA 2017-03-07 12:22:06 EST
Closing fixed.