ssb: Speculation on why I sometimes don't see names update.
All checks were successful
Build Tilde Friends / Build-All (push) Successful in 33m0s

This commit is contained in:
2025-05-17 20:10:15 -04:00
parent e3fcdea362
commit f979ff7050
2 changed files with 8 additions and 8 deletions

View File

@ -152,7 +152,7 @@ class TfElement extends LitElement {
async fetch_about(following, users) {
let ids = Object.keys(following).sort();
const k_cache_version = 2;
const k_cache_version = 3;
let cache = await tfrpc.rpc.databaseGet('about');
let original_cache = cache;
cache = cache ? JSON.parse(cache) : {};
@ -163,6 +163,12 @@ class TfElement extends LitElement {
};
}
let ids_out_of_date = ids.filter(
(x) =>
(users[x]?.seq && !cache.about[x]?.seq) ||
(users[x]?.seq && users[x]?.seq > cache.about[x].seq)
);
for (let id of Object.keys(cache.about)) {
if (ids.indexOf(id) == -1) {
delete cache.about[id];
@ -171,12 +177,6 @@ class TfElement extends LitElement {
}
}
let ids_out_of_date = ids.filter(
(x) =>
(users[x]?.seq && !cache.about[x]?.seq) ||
(users[x]?.seq && users[x]?.seq > cache.about[x].seq)
);
console.log(
'loading about for',
ids.length,