#3461 (Add support of websocket for react UI)
by khchine5 · in Developers · assigned to khchine5
Kurzbeschreibung
Add support of websocket for react UI as we have already with extjs. This will be used fot desktop notifications.
Kinder
- #3478 (A chat UI component lino.modib.chat) (by tonis in Developers assigned to khchine5)
Kommentare
- 6 Jahre, 9 Monate ago von tonis about #3461 (Add support of websocket for react UI) : Closing ticket and reopening one for a chat UI, As notification work in react at current.
- 6 Jahre, 9 Monate ago von tonis about #3461 (Add support of websocket for react UI) : Changes pushed, got a visual indicator in the right with a ! badge if the websocket is disconnected.
- 6 Jahre, 9 Monate ago von khchine5 about #3461 (Add support of websocket for react UI) : Could you push changes whenever theirs are stable, we I can help/ continue working on it.
- 6 Jahre, 9 Monate ago von tonis about #3461 (Add support of websocket for react UI) : Mmmhm, I'm not sure if there should be a group for each group chat possible, as the number would grow quiet large... I think a socket group per user is all that's needed and a global. Who's requiring a message will be determined by python logic and the group id can be sent with the message. It t...
- 6 Jahre, 9 Monate ago von khchine5 about #3461 (Add support of websocket for react UI) : Yes, we can use some idea from this tuto about chat using django channels channels.readthedocs.io/en/latest/tutorial/part_1.html
- 6 Jahre, 9 Monate ago von tonis about #3461 (Add support of websocket for react UI) : Great, that helps. Thinking perhaps to have a single socket connection for all notifications and chat messages, regardless of group.
There should though be some variation in url/stream for a mobile device VS pc, so we first send to pc, and if it's not seen after 30sec we then send to mobile. Reduce... - 6 Jahre, 9 Monate ago von khchine5 about #3461 (Add support of websocket for react UI) : Take a look at AuthMiddleware in the routing2.py file
- 6 Jahre, 9 Monate ago von khchine5 about #3461 (Add support of websocket for react UI) : The scope is defined in django-channels itself. See channels.readthedocs.io/en/latest/topics/consumers.html#scope
- 6 Jahre, 9 Monate ago von tonis about #3461 (Add support of websocket for react UI) : Got the websocket code working inside of react, however confused as to where the scope for the channel is defined, ie: if self.scope.get('user', False): in notify/consumers2.py
- 6 Jahre, 9 Monate ago von khchine5 about #3461 (Add support of websocket for react UI) : Add support of service Worker to react
- 6 Jahre, 9 Monate ago von khchine5 about #3461 (Add support of websocket for react UI) : Make desktop notifications works with react
- 6 Jahre, 9 Monate ago von khchine5 about #3461 (Add support of websocket for react UI) : Add get_js_includes and get_head_lines javascript code to react