-
Notifications
You must be signed in to change notification settings - Fork 73
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
[WIP] TF-3157 Implement web socket push #3168
base: master
Are you sure you want to change the base?
[WIP] TF-3157 Implement web socket push #3168
Conversation
This PR has been deployed to https://linagora.github.io/tmail-flutter/3168. |
lib/features/push_notification/data/datasource/web_socket_datasource.dart
Show resolved
Hide resolved
lib/features/push_notification/data/datasource_impl/remote_web_socket_datasource_impl.dart
Outdated
Show resolved
Hide resolved
lib/features/push_notification/data/datasource_impl/remote_web_socket_datasource_impl.dart
Outdated
Show resolved
Hide resolved
lib/features/push_notification/data/datasource_impl/remote_web_socket_datasource_impl.dart
Outdated
Show resolved
Hide resolved
lib/features/push_notification/data/datasource_impl/remote_web_socket_datasource_impl.dart
Outdated
Show resolved
Hide resolved
lib/features/push_notification/data/datasource_impl/remote_web_socket_datasource_impl.dart
Outdated
Show resolved
Hide resolved
lib/features/push_notification/domain/usecases/connect_web_socket_interactor.dart
Outdated
Show resolved
Hide resolved
lib/features/push_notification/presentation/controller/push_base_controller.dart
Outdated
Show resolved
Hide resolved
lib/features/push_notification/presentation/controller/push_base_controller.dart
Outdated
Show resolved
Hide resolved
lib/features/push_notification/presentation/controller/push_base_controller.dart
Outdated
Show resolved
Hide resolved
lib/features/push_notification/presentation/controller/push_base_controller.dart
Outdated
Show resolved
Hide resolved
lib/features/push_notification/presentation/controller/web_socket_controller.dart
Outdated
Show resolved
Hide resolved
|
@@ -7,4 +7,5 @@ class Constant { | |||
static const octetStreamMimeType = 'application/octet-stream'; | |||
static const pdfExtension = '.pdf'; | |||
static const imageType = 'image'; | |||
static const websocketBroadcastChannel = 'background-message'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
static const websocketBroadcastChannel = 'background-message'; | |
static const wsServiceWorkerBroadcastChannel = 'background-message'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
## Context | ||
|
||
- Currently Twake Mail web use Firebase Cloud Messaging to sync data on real time | ||
- JMAP already implement web socket push, which is more optimized for web |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- JMAP already implement web socket push, which is more optimized for web | |
- JMAP already implemented web socket push, which is more optimized for web |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
web/worker_service/worker_service.js
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
still not well understand about the logic of this file. Can you more details @dab246 ?
lib/features/push_notification/data/datasource_impl/remote_web_socket_datasource_impl.dart
Outdated
Show resolved
Hide resolved
lib/features/push_notification/data/datasource_impl/remote_web_socket_datasource_impl.dart
Outdated
Show resolved
Hide resolved
lib/features/push_notification/data/datasource_impl/remote_web_socket_datasource_impl.dart
Outdated
Show resolved
Hide resolved
lib/features/push_notification/data/datasource_impl/remote_web_socket_datasource_impl.dart
Outdated
Show resolved
Hide resolved
this.session = session; | ||
} | ||
|
||
void mappingTypeStateToAction( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add test for this method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
lib/features/push_notification/domain/usecases/connect_web_socket_interactor.dart
Show resolved
Hide resolved
lib/features/push_notification/presentation/controller/web_socket_controller.dart
Show resolved
Hide resolved
lib/features/push_notification/domain/usecases/connect_web_socket_interactor.dart
Outdated
Show resolved
Hide resolved
lib/features/push_notification/presentation/controller/push_base_controller.dart
Show resolved
Hide resolved
); | ||
|
||
// assert | ||
verify( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should make sure mailboxChangeListener
should not be invoked
); | ||
|
||
// assert | ||
verify( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should make sure mailboxChangeListener
should not be invoked
); | ||
|
||
// assert | ||
verify( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should make sure emailChangeListener
should not be invoked
); | ||
|
||
// assert | ||
verify( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
idem
Issue
Demo