Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New comment fetch #253

Open
Reeywhaar opened this issue Jan 16, 2019 · 3 comments
Open

New comment fetch #253

Reeywhaar opened this issue Jan 16, 2019 · 3 comments

Comments

@Reeywhaar
Copy link
Collaborator

It's 2k19, and I think it will be good if remark have option to fetch new comments, just like in chat, where you don't have to reload a page to see new comment. Github also shows new comments immediately after it was posted.

So, idea from the design view looks like this:
screenshot 2019-01-17 at 00 26 13
Notice thread margin on the left, and "2 new comments" button on the right, which upon click shows comments which appeared after user loaded the page.

From the backend/frontend side its:

  • server option autorefresh or with values off(default)|socket or something.
  • make use of https://github.com/googollee/go-socket.io which is basically websockets on steroids with option to downcast to http long polling and other features.
  • off value can be used to turn off autorefresh, as lot of websocket connections can kill cheap server.
  • on the frontend still https://socket.io/ may be used

Just my 2¢

@umputun umputun self-assigned this Jan 17, 2019
@umputun umputun mentioned this issue Jun 3, 2019
umputun added a commit that referenced this issue Jun 3, 2019
* add /stream/info as a cheap way to subscribe to comment updates #253

* add check for lastTS change to allow proper info streams in no-cache mode

* check write error in info stream and terminate

* flaky info stream test

* add stream info to readme

* separate timeout middleware foe each route's group

* debug info on stream close

* fix test for streams

* stream timeout on inactivity only

* throttle streams to 500

* restore common throttle
@umputun
Copy link
Owner

umputun commented Jun 3, 2019

I have added /stream/info API allowing to subscribe to update events. See #336 for details

note: this is not "comment fetch" but a way to get info if new comments were added (or removed) from the thread. This is not websocket either but a long connection with a timeout.

@Reeywhaar
Copy link
Collaborator Author

Hope I'll get the time this weekend

@umputun
Copy link
Owner

umputun commented Jul 1, 2019

Do you think we need a way to control stream/no-stream from my side? For example, we can have this streaming optional globally and populate "streams": true/false as a part of /config response.

@umputun umputun added this to the v1.4 milestone Jul 13, 2019
@umputun umputun removed this from the v1.4 milestone Jul 27, 2019
paskal added a commit that referenced this issue Nov 30, 2020
It was supposed to solve #253 but frontend part for it in
#357 was never finished, and backend code produces false
positive test failures since day 0. The cost of just having
this code around is too high, we'll re-add it in case
frontend implementation will be finished.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants