Skip to content

Core Integration (use @wireapp/core) #9646

Closed as not planned
Closed as not planned
@bennycode

Description

@bennycode

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 WebSocketService in webapp (and use API Client)
  • Remove BackendClient

Make MessageBuilder stateless

  • Remove apiClient & assetService members
  • Make create... functions in MessageBuilder static
  • Pass user id to create... functions as parameter
  • Pass responses from assetService.upload as params (to avoid actual upload in builder functions)

Replace Protobuf imports in webapp

  • Check for all occurences of @wireapp/protocol-messaging and reduce them
  • Replace functions that use PROTO_MESSAGE_TYPE (like AssetRepository.buildProtoAsset)
  • Be careful with functions that use GENERIC_MESSAGE_TYPE because they might need Cryptobox-specific data and will be migrated in a separate step
  • Extend MessageBuilder as needed to support audio messages, etc. (use shims for APIs like AudioContext which 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 a fetch against 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 logout event 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

Replace Cryptography Repository (to be defined later)

  • Use Cryptobox from '@wireapp/core'

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions