ssb: Add a lookup table of max sequence and timestamp per account.f
All checks were successful
Build Tilde Friends / Build-All (push) Successful in 20m47s

This commit is contained in:
2025-01-22 19:19:50 -05:00
parent c7a8ce7060
commit c728e05032
4 changed files with 27 additions and 22 deletions

View File

@ -402,10 +402,9 @@ class TfElement extends LitElement {
async fetch_user_info(users) {
let info = await tfrpc.rpc.query(
`
SELECT messages.author, MAX(messages.sequence) AS max_seq, MAX(timestamp) AS max_ts FROM messages
SELECT messages_stats.author, messages_stats.max_sequence, messages_stats.max_timestamp AS max_ts FROM messages_stats
JOIN json_each(?) AS following
ON messages.author = following.value
GROUP BY messages.author
ON messages_stats.author = following.value
`,
[JSON.stringify(Object.keys(users))]
);