Foros de discusión

Unable to unregister Push on Android with a custom session impl (issue)

thumbnail
Denis Signoretto, modificado hace 7 años.

Unable to unregister Push on Android with a custom session impl (issue)

Expert Mensajes: 375 Fecha de incorporación: 21/04/09 Mensajes recientes
Hi,

I'm facing a problem on Android. nregistering a device for push. I'm using a custom Session implementation.

I've seen that constructor of Push.java class creates a new instance of session object instantiating a new SessionImpl instead of using passed object.

_session = new SessionImpl(session);


I think this is an issue supporting different or extensions of Session. Do you agree? Is there a particular reason why Push constructor needs to create a new object?

Bye,
Denis.
thumbnail
Bruno Farache, modificado hace 7 años.

RE: Unable to unregister Push on Android with a custom session impl (issue)

Liferay Master Mensajes: 603 Fecha de incorporación: 14/05/07 Mensajes recientes
I think it's just because it needs a clean session, with no callback set. Maybe you can extend Push and override this?
thumbnail
Denis Signoretto, modificado hace 7 años.

RE: Unable to unregister Push on Android with a custom session impl (issue)

Expert Mensajes: 375 Fecha de incorporación: 21/04/09 Mensajes recientes
Hi Bruno,

our problem with Push class is that we are loosing heasders previously setted in the Session object. We've tried extending Push without success because constructor calls super which initialize Session with a new instance. We've found a workaround implementing our customizations in a Authentication.

It would be desiderable that SessionImpl(Session session) constuctor copy headers as well (or as alternative implement clone() method for Session and use it in Push constructor).

WDYT?

Bye,
Denis.
thumbnail
Bruno Farache, modificado hace 7 años.

RE: Unable to unregister Push on Android with a custom session impl (issue)

Liferay Master Mensajes: 603 Fecha de incorporación: 14/05/07 Mensajes recientes
I see, we can just make it simpler and not clone the session, as you have suggested previously. Does it work for you?
thumbnail
Denis Signoretto, modificado hace 7 años.

RE: Unable to unregister Push on Android with a custom session impl (issue)

Expert Mensajes: 375 Fecha de incorporación: 21/04/09 Mensajes recientes
Hi Bruno,

I think creating a new session object is a good choice because Push needs to alter it setting the callback (it would be safe to support multi-thread).
To keep it simple it should be sufficient that SessionImpl(Session session) constructor initialize headers too.

Bye,
Denis.