fix: admin/home: you could see stale warnings, even after an update
Massimo Melina committed
Apr 4, 2026 at 11:29 UTC
50d579b328c4bea6617d695736c421829122de39
1 file changed
+14
-10
src/github.ts
+14
-10
@@ -298,19 +298,20 @@ export const getProjectInfo = debounceAsync(async () => {
298
else
299
obj = { ...cachedCentralInfo.get() || JSON.parse(builtInJson) } // fall back to built-in
300
// merge byVersions info in the main object but collect alerts separately to preserve multiple instances
301
- const allAlerts: string[] = [obj.alert]
301
+ const newAlerts: string[] = [obj.alert]
302
for (const [ver, more] of Object.entries(popKey(obj, 'byVersion') || {}))
303
if (VERSION.match(new RegExp(ver))) {
304
- allAlerts.push((more as any).alert)
304
+ newAlerts.push((more as any).alert)
305
Object.assign(obj, more)
306
}
307
- _.remove(allAlerts, x => !x)
308
- alerts.set(was => {
309
- if (!_.isEqual(was, allAlerts))
310
- for (const a of allAlerts)
311
- console.log("ALERT:", a)
312
- return allAlerts
313
- })
307
+ _.remove(newAlerts, x => !x)
308
+ if (!_.isEqual(alerts, newAlerts)) {
309
+ alerts = newAlerts
310
+ if (newAlerts.length)
311
+ void checkForUpdates() // with new alerts, is best to have fresh updates info
312
+ for (const a of newAlerts)
313
+ console.log("ALERT:", a)
314
+ }
315
const black = onlyTruthy(Object.keys(obj.repo_blacklist || {}).map(findPluginByRepo))
316
blacklistedInstalledPlugins = onlyTruthy(black.map(x => _.isString(x.repo) && x.repo))
317
if (black.length) {
@@ -319,4 +320,7 @@ export const getProjectInfo = debounceAsync(async () => {
320
enablePlugin(p.id, false)
321
}
322
return obj
322
-}, { retain: HOUR, retainFailure: 60_000 })
\ No newline at end of file
323
+}, { retain: HOUR, retainFailure: 60_000 })
324
+
325
+// refresh of alerts and blacklist happens early without stalling startup
326
+configReady.then(getProjectInfo)