LiftRules.cometCreation doesn't work in Lift 3.x.x

44 views
Skip to first unread message

Josef Vlach

unread,
Aug 18, 2017, 7:05:21 AM8/18/17
to Lift
We are using Lift 2.6.3 and we want to migrate to Lift 3.1.0. We are using LiftRules.cometCreation for creating comet actors from code. 

But although LiftRules.cometCreation value still exists in 3.1.0 any logic for processing it is missing in the codebase.

I've made a humble attempt to fix this by porting initialization code for cometCreation from 2.6.3 into 3.1.0 and it is working, but I'm hitting problem when trying to logout from lift application with active comet actor. Redirect after logout is working fine, but consequent login request is being canceled (I assume this is due to a race condition when logout process is being finished in the time when next login request is proceeding causing it to be canceled).

So anyway my question is why cometCreation is just value without any logic. Was it left over undeleted by accident or is corresponding logic missing by accident?

Antonio Salazar Cardozo

unread,
Aug 18, 2017, 7:11:33 AM8/18/17
to Lift
Nope, you're absolute right and it seems like this was an oversight when I reworked comet initialization: https://github.com/lift/framework/pull/1585/files#diff-b03ffa476fa6a48ce2212116c4094e15R2661 :(

Can you by any chance use `LiftRules.cometCreationFactory`? It should be fairly easy to lift the PartialFunction into a (CometCreationInfo)=>Option[CometActor] and from there to the type the factory expects.

Meantime I'll look into what we can do to fix this.
Thanks,
Antonio

Josef Vlach

unread,
Aug 18, 2017, 10:24:07 AM8/18/17
to Lift
Thanks for confirmation.

Yes, I'm now working on updating our codebase to LiftRules.cometCreationFactory. It seems to be working fine, only issue I see is that with logout from the application (which I already mentioned).

On logout we are doing:

S.session.foreach(_.terminateHint)
S.session.foreach(_.destroySession())
S.redirectTo("/login")

But for some reason when browser do the redirect and the do the GET /login that request got canceled. This happens only when there is some comet actor active (when no comet actor is active logout works fine).

Is there some special way how to deactivate session when comet actors are being used? If not I may put together example project manifesting this behavior if needed.

Antonio Salazar Cardozo

unread,
Aug 18, 2017, 1:43:49 PM8/18/17
to Lift
Maybe related to https://github.com/lift/framework/issues/1145 somehow, but
we couldn't reproduce that one. An example project would be awesome so we
can try to figure this out a little more.
Thanks,
Antonio

Josef Vlach

unread,
Aug 19, 2017, 7:31:02 AM8/19/17
to Lift
Hi Antonio,

so it is not related to the issue you pointed out, It is much simpler as I've figured out the reason and way to fix it in the end, but I still assume it should be regarded as a bug.

Here is a repo with reproduction and description of the issue, cause of it, how one can fix it and what desired solution should be in my opinion.


Thanks
Josef

Matt Farmer

unread,
Aug 20, 2017, 9:36:52 AM8/20/17
to Lift
Thanks for doing this example project.

If I'm understanding things it sounds like there are two bugs?

The first is an issue with creating a Comet and the second is with not considering context path in our recovery redirect, right?

I'll go ahead and file the bug for the redirect issue. For my own clarification: did this redirect work correctly in 2.6.3? Or has this always been broken?

Thanks!

--
--
Lift, the simply functional web framework: http://liftweb.net
Code: http://github.com/lift
Discussion: http://groups.google.com/group/liftweb
Stuck? Help us help you: https://www.assembla.com/wiki/show/liftweb/Posting_example_code

---
You received this message because you are subscribed to the Google Groups "Lift" group.
To unsubscribe from this group and stop receiving emails from it, send an email to liftweb+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Josef Vlach

unread,
Aug 20, 2017, 12:12:33 PM8/20/17
to Lift
That is correct, there are two issues:

1. cometCreation has missing implementation,
2. cometOnSessionLost doesn't consider context.

This redirect worked in 2.6.3 as there is different implementation.

Matt Farmer

unread,
Aug 20, 2017, 1:20:34 PM8/20/17
to Lift
Got it, there are now tickets on the project for both of these issues.


We'll also backport these fixes to Lift 3.0 and Lift 3.1 once they're concluded. Feel free to watch the tickets on GitHub for further updates.

Thanks again for reporting! 
Reply all
Reply to author
Forward
0 new messages