question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Have a field to fetch last-n messages from Waku-Store in QueryOptions.

See original GitHub issue

This is a change request/support request

Problem

Right now, while fetching messages from waku-store using js-waku, if the number of messages is quite high then it takes quite a while to load the messages.

Proposed Solutions

So can we have an extra query option which only fetches the last-N messages from the DB?

Something like:

waku.store
      .queryHistory([ContentTopic], { count: 20 })
// fetches only the last 20 messages, if less than 20, then all are fetched.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:12 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
D4ntecommented, Oct 14, 2021

The change is now released in 0.14.0. I see you also fixed your code. Closing, please re-open or open a new issue if you face any other problem.

1reaction
D4ntecommented, Oct 4, 2021

Regarding your last point, actually I am working on the chat feature of a live-streaming platform, so now the thing is that we don’t want the user to wait for too long while the messages are fetched, and also we know that the frequency at which messages are sent on livestreams depend on the streamer’s popularity.

Please have a go at my proposal above in combination with timeFilter and let me know if this is still needed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Fetch and replace data from firestore to make a recent ...
I was wondering if there was a way to fetch the data of the very last message sent for the recent chat feed....
Read more >
Get a field value on the basis of condition in aggregation
i want to get createdAt field of last message of a specific user in agroup suppose here userId is any user . i...
Read more >
Fetch reference field as a displayed name REST API
Solved: Hi, I'm trying to fetch data from another dev instance. My question is how to fetch display name model and model category...
Read more >
Search query language - Graylog Docs
Syntax. The search syntax is very close to the Lucene syntax. By default all message fields are included in the search if you...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found