Skip to content

After a while wired events are not received #368

Closed
foobarto opened this Issue Jun 19, 2012 · 14 comments

4 participants

@foobarto

Something I've noticed recently when having a page that is using {% wire %} to receive events and update itself:

If you leave the page open for few hours it ceases to receive updates.

This happens on 0.8.0 / 10e59ee

@mworrell
Zotonic member

Maas-Maarten also saw this happening, we are trying to isolate the problem.

@mworrell
Zotonic member

Maas, did you see this as well?

@mmzeeman
Zotonic member

Yup, had no time to fix it yet. Will have to make something to detect a page-session restart from a page.

@mworrell
Zotonic member

Ah, it is connected to a crashing page session? Or is the page killed due to timeouts?

@mmzeeman
Zotonic member
@mworrell
Zotonic member

maybe we can keep a list of recent page-ids, so that we can resurrect a page when the process can't be found.

@mmzeeman
Zotonic member
@arjan
Zotonic member
arjan commented Oct 29, 2012

So how are we going to detect this; by using polling from javascript?

@mmzeeman
Zotonic member

When you add a stream on your page it needs to be kept alive just like a zotonic session. So maybe a timestamp which is updated by the server. When it gets too old then we can reconnect the stream or reload the page.

@arjan
Zotonic member
arjan commented Oct 30, 2012

like a heartbeat?

@mmzeeman
Zotonic member

Yes indeed. I was thinking about adding something like this when the stream starts::

setInterval(function() { 
   if(z_is_stream_alive()) return;
   // handle stream down... reconnect? or just reload?
}, 10000);

The server can then push z_stream_heartbeat(); This function updates a timestamp somewhere. With something which prevents it from being piggybacked on postback responses.

It would probably be nice to have some way to configure what happens when the stream goes down. For some apps a reconnect would suffice, but for others a reload of the page would be better.

Idea. It could that could be added as an action::

{% stream on_down={action} %}

Or?

@arjan
Zotonic member
arjan commented Dec 10, 2012

candidate for backporting to 0.8.x when solution is implemented

@arjan
Zotonic member
arjan commented Apr 17, 2014

is this still an issue?

@arjan arjan modified the milestone: Release 0.11, Release 0.10 Apr 17, 2014
@mmzeeman
Zotonic member

No I think not. The stream new connection logic should have taken care of this one.

@arjan arjan closed this Aug 14, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.