tmail-flutter
tmail-flutter copied to clipboard
[WIP] TF-3157 Implement web socket push
Issue
- #3157
Demo
This PR has been deployed to https://linagora.github.io/tmail-flutter/3168.
- [ ] Verify web socket when token expired
- [x] Verify web socket on background mode
Error connecting to web socket on lin-saas.dev
- [x] WebSocket automatically closes after sending message
Haven't seen it working yet. Please attach a demo video if you have tested it working properly.
WebSocket automatically closes after sending message
Currently web socket on lin-saas only lives in 1 minute. Not our problem
Currently web socket on lin-saas only lives in 1 minute. Not our problem
Not that sure. Does the current poc set up some websocket PING ?
Currently web socket on lin-saas only lives in 1 minute. Not our problem
Not that sure. Does the current poc set up some websocket PING ?
No ping. Does it state in the spec that we have to ping, and how often we need to ping?
Haven't seen it working yet. Please attach a demo video if you have tested it working properly.
https://github.com/user-attachments/assets/5dc8f1ef-7d2e-4ea1-b730-de30edaa252b
Does it state in the spec that we have to ping
Yes this is a standard websocket mechanism to keep connection open (otherwize Apisix closes it after 60 seconds)
https://api.flutter.dev/flutter/dart-io/WebSocket/pingInterval.html
Do it every 20 seconds.
Apisix closes it after 60 seconds
That is the Back-end decision, not in https://www.rfc-editor.org/rfc/rfc8887
Do it every 20 seconds.
Will update
That is the Back-end decision, not in https://www.rfc-editor.org/rfc/rfc8887
You are correct, but this document lacks proper guidance on exposing the timeouts (ideally in the session)
FYI something like that had been done on the regular Server sent event for JMAP: https://jmap.io/spec-core.html#event-source ping: A positive integer value representing a length of time in seconds, e.g., 300...
This was sadly omitted from the websocket spec so we will have to hard code it...
Do it every 20 seconds.
@chibenwa Done
- [x] WebSocket automatically closes after sending message
![]()
- [ ] Still get error when run web on debug mode with server
lin-saas.dev
Still get error when run web on debug mode with server lin-saas.dev
Browser?
Still get error when run web on debug mode with server lin-saas.dev
Browser?
Chrome MacOS
Still get error when run web on debug mode with server lin-saas.dev
Browser?
Chrome MacOS
Backend just deployed the fix. Check again
- [ ] Firefox not work. Get error:
- [x]
web_sockets_service.jsremoved when performCtrl + Shilf + Rshortcut key
web_sockets_service.js removed when perform Ctrl + Shilf + R shortcut key
https://blog.angular-university.io/service-workers/
If something is unclear while trying out Service Workers, trying to do a hard refresh (Ctrl+Shift+R) will not help in the learning process.
This is because if you hit hard-refresh, the whole Service Worker is going to be bypassed, and it won't control the page - This is the standard browser behavior which is unlikely to change.
Ctrl+Shift+R is meant to bypass all network caches, and because the Service Worker is often used for caching, it bypasses it too.
- [x] Sometime not work on chrome: Go to setting -> send email -> back to dashboard screen -> not update
https://github.com/user-attachments/assets/a2193e40-9695-4097-9fb5-f75da390de86