Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

After a while wired events are not received #368

Closed
foobarto opened this Issue · 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
Owner

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

@mmzeeman mmzeeman was assigned
@mworrell mworrell was assigned
@mmzeeman mmzeeman was assigned
@mworrell
Owner

Maas, did you see this as well?

@mmzeeman
Owner

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

@mworrell
Owner

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

@mmzeeman
Owner
@mworrell
Owner

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
Owner
@arjan
Owner

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

@mmzeeman
Owner

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
Owner

like a heartbeat?

@mmzeeman
Owner

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
Owner

candidate for backporting to 0.8.x when solution is implemented

@arjan
Owner

is this still an issue?

@arjan arjan modified the milestone: Release 0.11, Release 0.10
@mmzeeman
Owner

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

@arjan arjan closed this
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.