#3049 (Websocket connection in React for notifications)
by tonis · in Developers · assigned to Sharif Mehedi
Kurzbeschreibung
Kinder
Kommentare
- 4 Jahre, 3 Monate ago von Sharif Mehedi Antwort auf Luc Saffre about #3049 (Websocket connection in React for notifications) : I would like to join you virtually. Because, later I will also try to upgrade my machine to Ubuntu-22.04.
- 4 Jahre, 3 Monate ago von Sharif Mehedi about #3049 (Websocket connection in React for notifications) : STATUS_UPDATE:: working websocket notification on ExtJs.
- 4 Jahre, 3 Monate ago von Luc Saffre about #3049 (Websocket connection in React for notifications) : In [url dev.lino-framework.org/specs/notify.html] we added a sentence about how to play with desktop notifications.
- 4 Jahre, 3 Monate ago von Luc Saffre about #3049 (Websocket connection in React for notifications) : Sharif and I tested in noi1r on my machine : works perfectly. Good work, Sharif! In noi1e the notifications don't yet appear. Sharif wil have a look at it. Would be nice to get it there as well.
- 4 Jahre, 3 Monate ago von Luc Saffre about #3049 (Websocket connection in React for notifications) : Wait before closing it. I'd ideally like to have a visible/showable result in some demo project.
- 4 Jahre, 3 Monate ago von Sharif Mehedi about #3049 (Websocket connection in React for notifications) : we can probably consider this ticket closed.
- 4 Jahre, 3 Monate ago von Luc Saffre about #3049 (Websocket connection in React for notifications) (1 Antwort) : Yes, I am still using Ubuntu 18.04 on my laptop. I hope to have a physical meeting with Hannes some day where we would upgrade it. I prefer to make it with Hannes next to me.
- 4 Jahre, 3 Monate ago von Sharif Mehedi about #3049 (Websocket connection in React for notifications) : notification is fine from the backend, but the frontend require some adjustment.
- 4 Jahre, 3 Monate ago von Sharif Mehedi about #3049 (Websocket connection in React for notifications) : we now have channels-2.x support
- 4 Jahre, 3 Monate ago von Sharif Mehedi Antwort auf Luc Saffre about #3049 (Websocket connection in React for notifications) : I know the feature was already there. But I thought we should upgrade ourselves to channels-3.x.x
- 4 Jahre, 3 Monate ago von Sharif Mehedi Antwort auf Luc Saffre about #3049 (Websocket connection in React for notifications) : In that case, if we want to have support for redis<5, we will have to add support for channels-2.x.x.
- 4 Jahre, 3 Monate ago von Luc Saffre Antwort auf Luc Saffre about #3049 (Websocket connection in React for notifications) : I did "pip install channels-redis==2.4.2", which also changed versions of channels, msgpack and daphne. But now runserver doesn't even start. It says:
Starting ASGI/Channels version 2.4.0 development server at 127.0.0.1:8000/ Quit the server with CONTROL-C. Daphne running, listening on 127.0.0.1:800... - 4 Jahre, 3 Monate ago von Luc Saffre Antwort auf Luc Saffre about #3049 (Websocket connection in React for notifications) : Yes, I have Redis 4.0.9:
(py38) luc@tups:~$ sudo redis-server --version Redis server v=4.0.9 sha=00000000:0 malloc=jemalloc-3.6.0 bits=64 build=9435c3c2879311f3 - 4 Jahre, 3 Monate ago von Sharif Mehedi Antwort auf Luc Saffre about #3049 (Websocket connection in React for notifications) : Two similar stackoverflow threads: [url stackoverflow.com/questions/63592120/aioredis-errors-replyerror-err-unknown-command-bzpopmin-when-trying-to-use-re first], [url stackoverflow.com/questions/62786988/redis-err-unknown-command-bzpopmin second]. Where the later says to try with, `pip install chan...
- 4 Jahre, 3 Monate ago von Sharif Mehedi Antwort auf Luc Saffre about #3049 (Websocket connection in React for notifications) : Here is the link to [url redis.io/commands/bzpopmin/ BZPOPMIN] command, where it says BZPOPMIN command is available from redis-5.0.0. Since the traceback says unknown command, I can only think that it's probably because the redis is less then 5.0.0.
- 4 Jahre, 4 Monate ago von Luc Saffre about #3049 (Websocket connection in React for notifications) (6 Antworten) : On my machine I get the following traceback. redis is installed.
WebSocket HANDSHAKING /WS/ [127.0.0.1:51042] WebSocket CONNECT /WS/ [127.0.0.1:51042] Exception inside application: ERR unknown command 'BZPOPMIN' Traceback (most recent call last): File "/home/luc/virtualenvs/py38/lib/python3.8/site... - 4 Jahre, 4 Monate ago von Sharif Mehedi about #3049 (Websocket connection in React for notifications) : I just published my [url gitlab.com/lino-framework/lino/-/commit/4b279ba1ea296c056e9d6b599b16186fc0b20f73 changes]. The related modules are now simpler and easier to understand.
- 4 Jahre, 4 Monate ago von Sharif Mehedi about #3049 (Websocket connection in React for notifications) : I am going to get rid of notify.consumers2 and notify.routing2.
- 4 Jahre, 4 Monate ago von Sharif Mehedi about #3049 (Websocket connection in React for notifications) : What if some developer wants have websocket functionalities in some plugin? In such a case there should be a way to add the websocket_urlpatterns from the plugin to the root websocket_urlpatterns. Also, if they want to have channel worker, they should be able to add to worker(s) to the ASGI_APPLICAT...
- 4 Jahre, 4 Monate ago von Sharif Mehedi about #3049 (Websocket connection in React for notifications) : A question for @luc , should I try to re implement the chat feature? I will now try to integrate websockets in medico.
- 4 Jahre, 4 Monate ago von Sharif Mehedi about #3049 (Websocket connection in React for notifications) : Interestingly enough with some monkey patches, authentication issue is fixed now.
- 4 Jahre, 4 Monate ago von Sharif Mehedi about #3049 (Websocket connection in React for notifications) : Other than Authentication issue. react websocket feature is working fine.
- 4 Jahre, 4 Monate ago von Sharif Mehedi about #3049 (Websocket connection in React for notifications) : It seems we need our own AuthMiddlewareStack for channels.
- 4 Jahre, 4 Monate ago von Sharif Mehedi about #3049 (Websocket connection in React for notifications) : OBSERVATION: The `runserver` does not finds channels...runserver.Command when we append 'channels' to needs_plugins on Plugin.on_init (current notify.Plugin config) but works fine when directly set to the notify.Plugin.needs_plugins. Workaround, we can define our own runserver that should by default...
- 4 Jahre, 6 Monate ago von Sharif Mehedi about #3049 (Websocket connection in React for notifications) : OBSERVATION: daphne server has built-in functionalities for django-channel to serve an application that have capabilities for both the http and websocket protocols. Serving such application with other servers require some intensive work.
- 5 Jahre, 5 Monate ago von Sharif Mehedi about #3049 (Websocket connection in React for notifications) : now the push notification actions are ok to use. although we need to work on broadcast.
- 5 Jahre, 5 Monate ago von Luc Saffre about #3049 (Websocket connection in React for notifications) : Sharif, note that we might also want to "broadcast" notifications to all subscrptions, including anonymous ones. Not sure whether the current notify.Message supports it.
- 5 Jahre, 5 Monate ago von Sharif Mehedi about #3049 (Websocket connection in React for notifications) : I am creating some views and models to store and manage the PushNotificationSubscription(s) and url endpoints. Although, the django-webpush has the required models and views, that require specific data structure and forms layout. I intent to avoid django-webpush, and do the subscription management wi...
- 5 Jahre, 5 Monate ago von Luc Saffre about #3049 (Websocket connection in React for notifications) : Today Hamza and Sharif met for the first time. Hamza made a presentation of the notify and chat plugins. Meanwhile there is django-webpush, which seems to be more easy to use. The chat plugin uses django-channels and it also stores instant messages in the Lino database. django-webpush does not do th...
- 5 Jahre, 5 Monate ago von Sharif Mehedi about #3049 (Websocket connection in React for notifications) : Making our own push API is not feasible at the moment.
- 5 Jahre, 5 Monate ago von Sharif Mehedi about #3049 (Websocket connection in React for notifications) : Our service-worker is running in workbox. Although we need to reconfigure some route for specific sites to have precaching (offline capability) work properly. For notifications, we have a front-end skeleton in place to respond to push from the back-end. To send signal from back-end to a specific devi...
- 5 Jahre, 5 Monate ago von Luc Saffre about #3049 (Websocket connection in React for notifications) : Sharif is still having trouble establishing a secure connection from runsshserver. Some security warning of the browser, probably caused by the scope argument to ServiceWorker.registger(). So we decided to install nginx on his machine, using getlino. Similar to "Install lino on a production site", b...
- 5 Jahre, 5 Monate ago von Sharif Mehedi about #3049 (Websocket connection in React for notifications) : To enable push notification and also to create offline capabilities, we need to utilize serviceWorker. My opinion is that an web app that does not utilize the full capabilities of a modern browser that comes with serviceWorker is outdated and cheap. I wish to understand serviceWorker and started on ...