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

[DRAFT] Given pre-fetched OrbitDB entries, can Quiet iOS display new messages in < 1 second? #2070

Open
holmesworcester opened this issue Nov 14, 2023 · 5 comments

Comments

@holmesworcester
Copy link
Contributor

holmesworcester commented Nov 14, 2023

Our product goal is that a user can open Quiet and see all important messages in less than 1 second.

Assuming we have already fetched recent messages from a relay server and they are on our device (a safe assumption since many apps including Signal work this way) can Quiet iOS display them to the user in less than 1 second after coming back to the foreground?

Here are some cases we care about a lot:

  1. Easy case: Fresh community, 1 new message
  2. Joining user: Fresh community, 1000 new messages
  3. New message received: 20 channels, 1000 messages per channel, 1 new message
  4. Returning user: 20 channels, 1000 messages per channel, 100 new messages

If not, how slow is it? What are the bottlenecks?

Fetched data can be in whatever form is most convenient: OrbitDB entries, IPFS blocks, CAR files, whatever.

If OrbitDB needs several seconds to get started, we can also use another way of displaying new messages to the user immediately, while we wait for OrbitDB.

@holmesworcester holmesworcester converted this from a draft issue Nov 14, 2023
@holmesworcester holmesworcester changed the title Given pre-fetched messages, Quiet iOS displays new messages in less than 1 second [DRAFT] Given pre-fetched messages, Quiet iOS displays new messages in less than 1 second Nov 14, 2023
@leblowl
Copy link
Collaborator

leblowl commented Nov 16, 2023

Makes sense to me!

@holmesworcester holmesworcester moved this from Next Sprint to Research in Quiet Nov 21, 2023
@holmesworcester holmesworcester changed the title [DRAFT] Given pre-fetched messages, Quiet iOS displays new messages in less than 1 second Given pre-fetched OrbitDB entries, Quiet iOS displays new messages in less than 1 second Dec 1, 2023
@holmesworcester holmesworcester changed the title Given pre-fetched OrbitDB entries, Quiet iOS displays new messages in less than 1 second Given pre-fetched OrbitDB entries, Quiet iOS can display new messages in less than 1 second Dec 1, 2023
@holmesworcester holmesworcester changed the title Given pre-fetched OrbitDB entries, Quiet iOS can display new messages in less than 1 second [DRAFT] Given pre-fetched OrbitDB entries, Quiet iOS can display new messages in less than 1 second Dec 1, 2023
@holmesworcester
Copy link
Contributor Author

@leblowl does this updated draft make sense?

@holmesworcester holmesworcester changed the title [DRAFT] Given pre-fetched OrbitDB entries, Quiet iOS can display new messages in less than 1 second [DRAFT] Given pre-fetched OrbitDB entries, can Quiet iOS display new messages in < 1 second? Dec 1, 2023
@holmesworcester
Copy link
Contributor Author

holmesworcester commented Dec 5, 2023

Notes:

  1. Try to get the data injected directly into OrbitDB. Can we do this, how hard is it?
  2. Is there a way to insert message JSON into the frontend, and then handle syncing once we're connected to the network?
    2.1. We could blend messages using timestamps and de-dupe with ID. Messages would need to be validated at least as well as we are now.
    2.2. If the way we're inserting data gets interrupted, the application could become unusable.

@leblowl leblowl moved this from Research to In progress in Quiet Dec 8, 2023
@leblowl leblowl self-assigned this Dec 8, 2023
@holmesworcester
Copy link
Contributor Author

holmesworcester commented Dec 14, 2023

Today Wiktor and Lucas convinced me that #2069 is a more straightforward and direct research question, even if we are ultimately interested in relays more than always-on libp2p/orbitdb nodes. Moving to backlog.

@holmesworcester holmesworcester moved this from In progress to Backlog - Desktop & Backend in Quiet Dec 14, 2023
@leblowl
Copy link
Collaborator

leblowl commented Jan 4, 2024

I was able to add entries directly to OrbitDB: #2190 This is immediate, but how quickly the frontend connects to the backend and actually displays messages after resume seems to be variable. Sometimes its quite quick but other times it looks like it takes up to around 7 seconds.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Backlog - Desktop & Backend
Development

No branches or pull requests

2 participants