poxa icon indicating copy to clipboard operation
poxa copied to clipboard

History support

Open arrowcircle opened this issue 10 years ago • 7 comments

People asked pusher to make history. Its bad for user experience when you change page and loose message. Its cool to have "custom made" history for pusher. Any ideas?

arrowcircle avatar Apr 29 '15 11:04 arrowcircle

My first thought would be that this could be an optional plugin?

I like how simple Poxa is. Just pull and fire it up, and it works great.

But this would add some form of data persistence... the slippery slope, haha!

darrencauthon avatar Apr 29 '15 14:04 darrencauthon

@darrencauthon I think history should be short, like 5 last messages for 5 minutes. Also, mnesia is standart erlang/elixir library so its not a problem. I agree with you, it should be optional.

arrowcircle avatar Apr 29 '15 15:04 arrowcircle

I will think on a sane way of having this, but I'm not sure if it's the case for Poxa. As @darrencauthon said if this could is done, it will be built on a way that is optional.

It's important to notice that It's not that it's not simply "use mnesia" because when we go distributed (and we are close to get there) this will be a problem as mnesia will not handle nicely a netsplit for example. Also other nuances that I don't even know as I never used mnesia for something that it wasn't an example code...

I would be glad to discuss some way of achieving this.

edgurgel avatar Apr 30 '15 07:04 edgurgel

@edgurgel I think for netsplit, history can be lost, because its not sensitive data. Netsplits are rare so its not a problem. I have no experience with distributed mnesia, but it seems like a good candidate for me.

arrowcircle avatar Apr 30 '15 08:04 arrowcircle

@edgurgel Also, there is an erlang project with history functionality and decent code https://github.com/doubleyou/dps

arrowcircle avatar Apr 30 '15 22:04 arrowcircle

There are also concerns on how to give this history. This would need to be an extension to Pusher Protocol or some convention of event(s) that will happen when you subscribe.

edgurgel avatar May 02 '15 05:05 edgurgel

As I know, pusher support user events, so it can be done with custom user event "history". Another option, is to use history option in config for each app id and send history after each user connection.

Second option is very arguable, but viable if first one is not easily available.

What do you think?

arrowcircle avatar May 02 '15 08:05 arrowcircle