Merge pull request #1122 from PR0M3TH3AN/fix-watch-history-sync-17826641022307563096

Fix watch history sync speed, caching, and deletion persistence
This commit is contained in:
thePR0M3TH3AN authored and GitHub committed 2026-01-07 13:34:39 -05:00
commit 8cb3da3129
3 files changed
+13 -5

No files matched your search

+3 -1
View File
@@ -2400,7 +2400,9 @@ export function createWatchHistoryRenderer(config = {}) {
showFeatureDisabledState();
return;
}
await this.refresh({ ...options, force: true });
// Use cached data immediately if available (force: false) unless overridden
const force = options.force === true;
await this.refresh({ ...options, force });
},
async ensureInitialLoad(options = {}) {
if (!state.initialized) {
+10
View File
@@ -1640,6 +1640,16 @@ class WatchHistoryManager {
WATCH_HISTORY_MAX_ITEMS,
);
// Ensure empty months are preserved so they get cleared on relays
if (cachedEntry.records && typeof cachedEntry.records === "object") {
const oldKeys = Object.keys(cachedEntry.records);
for (const oldKey of oldKeys) {
if (!records[oldKey]) {
records[oldKey] = [];
}
}
}
// Calculate fingerprint
const fingerprint = await this.getFingerprint(resolvedActor, records);
const flatItems = Object.values(records).flat();
-4
View File
@@ -5833,10 +5833,6 @@ export class ProfileModalController {
try {
await renderer.ensureInitialLoad({ actor: primaryActor });
await renderer.refresh({
actor: primaryActor,
force: true,
});
if (!this.boundProfileHistoryVisibility) {
this.boundProfileHistoryVisibility = () => {