google-code-export / gwt-platform

Automatically exported from code.google.com/p/gwt-platform
1 stars 0 forks source link

RootPresenter.onResetPresenters should be wrapped in a try/catch #447

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a presenter where onReset is overridden and throws an uncaught 
exception (e.g. null exception).
2. Fire a ResetPresentersEvent so that the RootPresenter.onResetPresenters 
method gets called.

What is the expected output? What do you see instead?
The expected output would be that the MVP framework either recovers gracefully 
or that a very serious error is thrown to indicate that the presenter 
life-cycle is forever broken for the session.

What is currently happening is that the 'isResetting' field in 
RootPresenter.onResetPresenters is never being reset back to 'false' after the 
exception bubbles out, which in turn forever breaks the mvp life-cycle until 
the application is refreshed. The application can seem like it works after an 
event like this but in fact it isn't and strange behavior begins to happen that 
can be difficult to track down. The strange behavior is resulting from that 
'isResetting' flag always being true so subsequent calls to the method do not 
process as they should.

What version of the product are you using? On what operating system?
gwtp v0.6

Please provide any additional information below.
A simple try/catch/finally would likely solve the problem where the 
'isResetting' field is always reset back to 'false'. The exception will get 
re-thrown and the application can handle it as it sees fit. At least the mvp 
life-cycle will still be intact at this point.

Another approach would be to catch and throw a more serious error that 
indicates the mvp life-cycle is now broken.

Original issue reported on code.google.com by xsegr...@gmail.com on 12 Dec 2012 at 5:41