#193 Live update for feed widget
Closed by atelic. Opened by atelic.
atelic/fedora-hubs feature/feed-sse  into  develop

Download 193.patch

Adds

  • Streaming server for fmn
  • API route to filter out notifications that do not apply to the user's filter settings
  • JS to respond to the Server Sent Events, and create a new DOM element from the markup generated by the API route

In order to reduce future conflicts, the tests for this can be found on the unittest branch.

Hubs doesn't have a config dict in the jinja environment like Pagure does so I wasn't sure how to handle this. Thoughts welcome

Looks fine, but you could import requests up top and then replace the above 3 lines with:

json_response = requests.get(url).json()

So we don't need this subscriber?

I wrote this file and was basing it off pagure ev server. A subscriber is needed if the server gets requests back correct? If you have a moment some time this week could you and pingou explain what is needed out of the streaming server so I can finish it up. At the moment it was a rough mock that atelic could use to complete the front end code

we should remove this :P this was me just playing around with the hello world app and not related to hubs

yea we could :P i'm not sure why I did it this way the first time arround

I would add a note that the SSE server provided here isn't meant to stay as, as I see it, the SSE server should be added to FMN itself.

The idea is then that hubs subscribe to the SSE of a specific hub (user/group) and get its notifications from there

2 new commits added

  • Add tests for feed update and improve speed
  • Front end for live update for feed widget

tests pass in this branch. the unittests for + @app.route('/api/fedmsg/markup', methods=['GET']) are in unittest branch.

I'm thinking we should merge this into master now. and then merge unittest into master

My only concern is that the JS for connecting to the streaming server is hardcoded at localhost:9090 since config isn't passed into jinja templates as far as I could tell.

I was hoping a reviewer would know how to address this.

Well, we could make one like pagure has, we may need this in other places in the future as well

:thumbsup: for me, we can always do the config change later

Is this PR still valid considering PR#200 ?

Pull-Request has been closed by atelic

Metadata