Responding to "mapped function not found on server"

20 views
Skip to first unread message

Andreas Joseph Krogh

unread,
Feb 18, 2015, 7:31:29 AM2/18/15
to Lift
Hi all.
 
I'm facing an issue where several of our users are reporting that AJAX-clicks "don't do anything". It appears the users have put their computers to sleep (suspend-mode) and resumed again after aprox. 15 min. They are still logged in but all functions have been GC'd on the server so the AJAX-call returns empty.
 
Ideally I'd display some kind of message saying; "Page have timed-out, please reload the page", but how to I detect this state on the client?
 
Thanks.
 
--
Andreas Joseph Krogh
CTO / Partner - Visena AS
Mobile: +47 909 56 963

Matt Farmer

unread,
Feb 18, 2015, 8:17:36 AM2/18/15
to Lift
Shouldn’t the AJAX ping for the page be realizing this is happening and trigger a reload? Or does that only happen if the whole session has expired? o.O


Matt Farmer Blog | Twitter


--
--
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.

Andreas Joseph Krogh

unread,
Feb 18, 2015, 8:32:52 AM2/18/15
to lif...@googlegroups.com
På onsdag 18. februar 2015 kl. 14:17:31, skrev Matt Farmer <ma...@frmr.me>:
Shouldn’t the AJAX ping for the page be realizing this is happening and trigger a reload? Or does that only happen if the whole session has expired? o.O
 
AFAICS that only happens when the session has expired and we don't have a mechanism in place for handling this.
 
Do someone have a work-around not involving tuning the lifespan of functions to the lifespan of the session?
 
Shall I open an issue for this in master (3.0)?
 
--
Andreas Joseph Krogh
CTO / Partner - Visena AS
Mobile: +47 909 56 963
 

David Miguel Antunes

unread,
Feb 18, 2015, 8:42:59 AM2/18/15
to lif...@googlegroups.com

I use this to reload the page if a function is unmapped:
LiftRules.handleUnmappedParameter.default.set(Vendor.apply((_, f) => {
if (f.startsWith("F")) Reload
}))
Cheers,
David

 

--

Andreas Joseph Krogh

unread,
Mar 5, 2015, 5:01:43 AM3/5/15
to lif...@googlegroups.com
På onsdag 18. februar 2015 kl. 14:42:31, skrev David Miguel Antunes <davidbr...@gmail.com>:
 
I use this to reload the page if a function is unmapped:
LiftRules.handleUnmappedParameter.default.set(Vendor.apply((_, f) => {
  if (f.startsWith("F")) Reload
}))
 
Are you sure you're using that exact code? It doesn't do anything..
 
If you wrap Reload in S.appendJs(Reload) it'll work.

David Miguel Antunes

unread,
Mar 5, 2015, 5:24:34 AM3/5/15
to lif...@googlegroups.com

Yep, I think you're right: the return of that is Unit:
Inline images 1

It probably seemed to be working because I was also reloading when losing the comet session:
LiftRules.noCometSessionCmd.default.set(Vendor.apply(() => Reload))
so that should probably be the reload that was triggering.

Thanks for the fix : )

David

--
Reply all
Reply to author
Forward
0 new messages