Skip to content
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

Core Integration (use @wireapp/core) #9646

Open
4 of 28 tasks
bennycode opened this issue Sep 14, 2020 · 0 comments
Open
4 of 28 tasks

Core Integration (use @wireapp/core) #9646

bennycode opened this issue Sep 14, 2020 · 0 comments

Comments

@bennycode
Copy link
Contributor

bennycode commented Sep 14, 2020

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'
@bennycode bennycode changed the title Core Integration (use @wireapp/core in webapp) Core Integration (use @wireapp/core) Sep 14, 2020
@bennycode bennycode assigned bennycode, Yserz and ffflorian and unassigned bennycode Sep 14, 2020
@bennycode bennycode pinned this issue Mar 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants