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

Notification concatenation support #5

Open
v1k45 opened this issue Dec 20, 2015 · 4 comments
Open

Notification concatenation support #5

v1k45 opened this issue Dec 20, 2015 · 4 comments

Comments

@v1k45
Copy link
Owner

v1k45 commented Dec 20, 2015

I am trying to implement notification concatenation support for the app.
Notification concatenation will give ability to add multiple actors to the notification instead of creating separate notification.
It will render the notification like John, Joe and 24 others followed you instead of rendering all 26 notifications with the same target and recipient separately.

This implementation will simply update the time stamp of the notification and add actors to it. This creates a problem because the notification update view uses notification id as the flag to fetch new notification which are greater than that of the notification id sent by the flag parameter (read more @ docs). It will not update the primary key of the notification, so fetching new notification will be quite a mess here.

So, I thought of changing the update mechanism from ajax polling to websockets. The problem is, there are many ways to do it but the popular way is either to use Node.JS or to follow a python approach where a change in WSGI settings is required.

My question is What will be the best way to do add websocket support to the app?

@fgmacedo
Copy link
Contributor

@v1k45 if we change the update view to receive a timestamp instead of notification id?

With a timestamp the server can send back all the updates since then, and the javascript part can do the local updates based on the IDs that are new, and the ones that are already on the DOM, but need to be updated.

On the regards of doing websockets, there's a plan to bring channels to Django 1.10, backported to 1.8 and 1.9. But it may take a while. This project was chosen to be founded by Mozzila to receive US$ 150k. So I think that will be the best way to do websockets on Django.

@v1k45
Copy link
Owner Author

v1k45 commented Dec 20, 2015

Yeah, updating things with respect to the last modified timestamp is indeed a good idea. I think we should follow the ajax polling approach until channels is added into django.

Also, this approach will drop support for anonymous text field for actors and target. I just wanted to know if the anonymous fields are important for a anyone other than me. If not, we can simply remove them before anyone uses the app in production.

@v1k45
Copy link
Owner Author

v1k45 commented Dec 30, 2015

Notification concatenation features are added in nf_concat_support branch. Currently, it only supports Django 1.8.X on Python3.

I'll try to extend support as soon as possible :)

@galeo
Copy link

galeo commented Apr 10, 2018

Any progress?

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

3 participants