aino-komal / mvp4g

Automatically exported from code.google.com/p/mvp4g
0 stars 0 forks source link

ClearHistory HistoryConverter doesn't work #58

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

Calling an event with the provided ClearHistory converter as specified in:
http://code.google.com/p/mvp4g/wiki/PlaceService#Clear_History_Token

Example of problem:
calling eventBus.logout as defined here:

@DisplayChildModuleView(AuthenticationModule.class)
@Event(modulesToLoad = AuthenticationModule.class, handlers = 
ContentPresenter.class, historyConverter = ClearHistory.class)
public void logout(IContentPanel parentPanel);

What is the expected output? What do you see instead?
Expected:
http://127.0.0.1:8888/IFathom.html?gwt.codesvr=127.0.0.1:9997

Actual: 
http://127.0.0.1:8888/IFathom.html?gwt.codesvr=127.0.0.1:9997#monitor/overview

What version of the product are you using? On what operating system?
1.3 snapshot, win7, chrome 9

Please provide any additional information below.

Original issue reported on code.google.com by bradley....@gmail.com on 17 Dec 2010 at 7:01

GoogleCodeExporter commented 9 years ago
Is there any event called after you fire the logout event (maybe by its 
handlers ContentPresenter)? Would you mind posting the Mvp4g logs (by 
activating the debug mode)?

Thanks,
Pierre

Original comment by plcoir...@gmail.com on 17 Dec 2010 at 7:23

GoogleCodeExporter commented 9 years ago
I fire one event to stop polling, but it doesn't use a history converter.  I 
attached the relevant portion of the logs, and all the related classes.

(just ignore the startup sequence - its a bit wonky)

Original comment by bradley....@gmail.com on 17 Dec 2010 at 8:14

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks for the files, I looked at them and I haven't noticed anything that 
would explain the error. 

I just notice 2 things that don't seem normal but I don't think it explains the 
error:
-the logout event seems to be fired too many times (6) on the event bus
-this configuration is incorrect since it can create loops:
@DisplayChildModuleView(AuthenticationModule.class)          
@Event(modulesToLoad = AuthenticationModule.class, handlers = 
ontentPresenter.class, historyConverter = ClearHistory.class)
public void logout(IContentPanel parentPanel);  
=> when you call logout, AuthenticationModule is loaded; this calls 
AuthenticationModule to display its start view by calling the logout event, 
which will reload AuthenticationModule. However you set AuthenticationModule 
feature to false so it shouldn't impact your code but I would suggest you to 
remove the @DisplayChildModuleView just incase.

I use ClearHistory in the Mvp4gModule example and in my work project with the 
latest snapshot of Mvp4g with no issue so I'm wondering if you have a 
particular case with this event. Does the ClearHistory work with another event 
or you have the same problem?

Could you compile your application with the -gen extras flag activated? This 
way, the Mvp4gModuleImpl should be generated inside the extras folder. Could 
you upload this file? This may not be possible but if you have a simple project 
that I can test to reproduce the issue, this would help a lot. Thanks.

Original comment by plcoir...@gmail.com on 20 Dec 2010 at 1:55

GoogleCodeExporter commented 9 years ago
Sorry for the delay in response.  I know the startup is wonky, but because I
can't have the @Events(startView) be a view in a child module (different
eventbus), I was trying to have it automatically throw the logout event and
get it to the correct screen that way (I'm planning on fixing it better
later).

Good call on the @DisplayChildModuleView though, I hadn't really looked at
those tags in a bit, and didn't realize I was misusing them.

ClearHistory works when it's for a different event that is not forwarded to
a child module, however it doesn't work if the event has the modulesToLoad
property.

Original comment by bradley....@gmail.com on 20 Dec 2010 at 7:17

GoogleCodeExporter commented 9 years ago
I tested an example where I set the ClearHistory for an event that loads other 
modules but I couldn't reproduce the error.

Could you post the Mvp4gModule and the AuthenticationModule implementation? 
Could also update your Mvp4g logs with the logs activated for the 
iFathomEventBus and AuthenticationEventBus. This may help to understand why the 
logout event is called so many times. If you remove the modulesToLoad attribute 
from the logout event, does clear history work fine? Thanks.

Original comment by plcoir...@gmail.com on 20 Dec 2010 at 11:52

GoogleCodeExporter commented 9 years ago
Marked as invalid since I couldn't reproduce it.

Original comment by plcoir...@gmail.com on 5 Sep 2013 at 4:29