fix: fallback to direct file fetch in ActivityDetailLoader

If the index-based lookup fails (shard fetch silently failed, stale
index state, etc.), try fetching the activity detail file directly from
each user shard's _merged/activities/ directory. This makes private
activities and newly-synced activities accessible even when the index
resolution fails.

Also add console.error logging when shards fail in resolveShards to
help diagnose root causes.
This commit is contained in:
Davide Scaini
2026-04-13 13:04:46 +02:00
parent 1587d1cdf3
commit 2ebfc7046d
2 changed files with 65 additions and 1 deletions
+7
View File
@@ -99,6 +99,13 @@ async function resolveShards(
}),
);
// Log shard fetch failures to help diagnose missing-activity issues
shardResults.forEach((r, i) => {
if (r.status === 'rejected') {
console.error('[bincio] shard fetch failed:', index.shards[i]?.url, r.reason);
}
});
const own = index.activities ?? [];
const fromShards = shardResults.flatMap(r => r.status === 'fulfilled' ? r.value : []);
return [...own, ...fromShards];