feathers-plus / feathers-offline-realtime

Offline-first realtime replication, with optimistic updates while connected.
MIT License
33 stars 9 forks source link

Default longpolling if the client provided is rest client #13

Closed subodhpareek18 closed 7 years ago

subodhpareek18 commented 7 years ago

Though the documentation already contains a section for periodic inspection https://docs.feathersjs.com/guides/offline-first/configure-realtime.html#example-using-periodic-inspection

I think it'll be really useful if the engine can do it on it's own internally. First check if the client transport is rest and if so start longpolling with a sensible default of N seconds, which can obviously be overridden via options.

It could seem like magic at first, but I guess that's the entire point of this realtime engine, to simply replicate the records without us having to worry about how its doing so.

eddyystop commented 7 years ago

The replicator is intended for use with WebSocket clients only.

WebSockets can do anything a REST client can, but more efficiently

subodhpareek18 commented 7 years ago

Yes that's true, WS would be my first choice as well. But I was currently facing issues with the authentication bits with the WebSocket client, @marshallswain is helping me debug that issue in this repo https://github.com/zusamann/feathers-socket-auth-issue.

Which is why for now I was trying to set this up using the REST client. But I won't be trying to do that anymore and probably create my own little replication engine helper in the meantime.

eddyystop commented 7 years ago

Implementing long polling is not currently on the roadmap.