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

API for querying latest msg timestamps #274

Open
staltz opened this issue Oct 29, 2021 · 0 comments
Open

API for querying latest msg timestamps #274

staltz opened this issue Oct 29, 2021 · 0 comments
Labels
enhancement 🌱 New feature or request

Comments

@staltz
Copy link
Member

staltz commented Oct 29, 2021

We need a better API for querying the latest timestamps (or measuring "recency") of messages by author. We should not need to use internal ssb-db2 methods to achieve it.

I could do sbot.db.getLatest(authorId, (err, {offset,sequence} => but from the offset and sequence I can't get the message itself (in order to get the timestamp).

I'm currently doing it in a hacky way that uses internal APIs:

https://github.com/ssb-ngi-pointer/ssb-suggest-lite/blob/dbcc02ca35c134aceac45c855cd129dc695db8b7/src/index.ts#L129-L132

@staltz staltz added the enhancement 🌱 New feature or request label Oct 29, 2021
@staltz staltz self-assigned this Oct 29, 2021
@staltz staltz removed their assignment Apr 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement 🌱 New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant