-
Notifications
You must be signed in to change notification settings - Fork 296
Closed as not planned
Description
Use WebSocket from API client
- Replace connectivity listener (i.e.
BackendClient.CONNECTIVITY_CHECK_TRIGGER) -
EventRepository: Check if WebSocket buffer for incoming messages can be replaced -
PromiseQueue: Check if buffer/queue for outgoing messages can be replaced - Remove
WebSocketServicein webapp (and use API Client) - Remove
BackendClient
Make MessageBuilder stateless
- Remove
apiClient&assetServicemembers - Make
create...functions inMessageBuilderstatic - Pass user id to
create...functions as parameter - Pass responses from
assetService.uploadas params (to avoid actual upload in builder functions)
Replace Protobuf imports in webapp
- Check for all occurences of
@wireapp/protocol-messagingand reduce them - Replace functions that use
PROTO_MESSAGE_TYPE(likeAssetRepository.buildProtoAsset) - Be careful with functions that use
GENERIC_MESSAGE_TYPEbecause they might need Cryptobox-specific data and will be migrated in a separate step - Extend
MessageBuilderas needed to support audio messages, etc. (use shims for APIs likeAudioContextwhich exist in browsers but not on Node.js)
Handle clients in the core
- let the core store clients in the database
- add a simple API to access clients from the Account instance:
-
verifyClient(userId, clientId)> update the client as validated by the user -
getClients(userId)> get all the clients for a user (will do afetchagainst the backend to get the freshest clients). Mostly for viewing in the UI, not for sending messages -
deleteSelfClent(cliendId)> when the user deletes one of his own clients -
getLocalClient()> used in the preference>account page - fire the
logoutevent when the local client is being removed from another device -
areUsersVerified(userIds)> to check if a conversation with some users is verified (please find a better naming) - ... (other usages in the webapp not yet identified)
-
- cache/store clients inside the core for message sending (given some user ids we want to send a message to, the core can match clients internally and encrypt the payloads)
- Update internal clients when a mismatch happens (add/remove clients)
- compute conversation verification/degraded state when a verified user has a new device after a mismatch
- add a hook to warn the webapp when a conversation is degraded/verified
Let the core decrypt messages
- By using the
account.on(payloadtype)event listeners we will get the decrypted messages right out from the core (and we can should be able to completely remove theCryptographyRepositoryfrom the webapp) (needs feat(core): Add option to set a domain on an account wire-web-packages#4168 to handle non federated backends)
Replace Cryptography Repository (to be defined later)
- Use Cryptobox from '@wireapp/core'