Skip to content

Commit 3a3118a

Browse files
committed
fix(admin): await checkPluginForUpdates and emit array on error
Qodo flagged that checkUpdates emitted the unresolved Promise (missing await) and emitted {} for updatable on the error path, both breaking the admin UI's expected string[] shape. Pre-existing bug surfaced when the surrounding block was edited for the privacy.pluginCatalog gate. Refs #7524
1 parent 15011a1 commit 3a3118a

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎src/node/hooks/express/adminplugins.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,14 @@ exports.socketio = (hookName:string, args:ArgsExpressType, cb:Function) => {
7171
}
7272
// Check plugins for updates
7373
try {
74-
const updatable = checkPluginForUpdates();
74+
const updatable = await checkPluginForUpdates();
7575

7676
socket.emit('results:updatable', {updatable});
7777
} catch (err) {
7878
const errc = err as ErrorCaused
7979
console.warn(errc.stack || errc.toString());
8080

81-
socket.emit('results:updatable', {updatable: {}});
81+
socket.emit('results:updatable', {updatable: []});
8282
}
8383
});
8484

0 commit comments

Comments
 (0)