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:
Cory McWilliams 2025-05-17 20:10:15 -04:00
parent e3fcdea362
commit f979ff7050
2 changed files with 8 additions and 8 deletions

View File

@ -1,5 +1,5 @@
{ {
"type": "tildefriends-app", "type": "tildefriends-app",
"emoji": "🦀", "emoji": "🦀",
"previous": "&xtu0KJ63/WsxuSXqYV68rs2rPJeJJjAQ3GKXy/SGHhA=.sha256" "previous": "&vqEnKoL61nS6/nfbezpmZP2KaIgsvAtQHb/DkkyxCR4=.sha256"
} }

View File

@ -152,7 +152,7 @@ class TfElement extends LitElement {
async fetch_about(following, users) { async fetch_about(following, users) {
let ids = Object.keys(following).sort(); let ids = Object.keys(following).sort();
const k_cache_version = 2; const k_cache_version = 3;
let cache = await tfrpc.rpc.databaseGet('about'); let cache = await tfrpc.rpc.databaseGet('about');
let original_cache = cache; let original_cache = cache;
cache = cache ? JSON.parse(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)) { for (let id of Object.keys(cache.about)) {
if (ids.indexOf(id) == -1) { if (ids.indexOf(id) == -1) {
delete cache.about[id]; 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( console.log(
'loading about for', 'loading about for',
ids.length, ids.length,