mirror of
https://github.com/Studio-Saelix/sencho.git
synced 2026-08-30 12:09:15 +00:00
fix(notifications): neutralize satellite-local node names in alert bodies (#1640)
* fix(notifications): neutralize satellite-local node names in alert bodies Fleet-aggregated alerts embedded each instance seed name (often Local) while the hub badge already named the remote. Drop identity prefixes and use type-aware local wording so attribution stays on the badge. * fix(docs): correct image-update default check cadence Operator docs still said six-hour polling; the seeded default is two hours in interval mode, and the cadence is configurable or cron-based. * test(notifications): assert hub stamps roster name on neutral remote bodies Cover the fan-in path that attaches hub roster identity while leaving the satellite message body unchanged.
This commit is contained in:
@@ -298,7 +298,15 @@ export class SchedulerService {
|
||||
if (task.node_id != null && task.action !== 'snapshot') {
|
||||
const node = db.getNode(task.node_id);
|
||||
if (!node) throw new Error(`Target node (id=${task.node_id}) no longer exists`);
|
||||
if (node.status === 'offline') throw new Error(`Target node "${node.name}" is offline`);
|
||||
if (node.status === 'offline') {
|
||||
// Local seed name ("Local") must not reach fleet-aggregated alerts;
|
||||
// remote roster names stay for diagnosis.
|
||||
throw new Error(
|
||||
node.type === 'local'
|
||||
? 'Target node is offline'
|
||||
: `Target node "${node.name}" is offline`,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (isDebugEnabled()) console.log(`[SchedulerService:debug] Task ${task.id} pre-checks passed, executing ${task.action}`);
|
||||
@@ -813,8 +821,12 @@ export class SchedulerService {
|
||||
* segment.
|
||||
*/
|
||||
private containerNotFoundMessage(containerName: string, nodeId: number): string {
|
||||
const nodeName = NodeRegistry.getInstance().getNode(nodeId)?.name ?? String(nodeId);
|
||||
return `Container "${containerName}" not found on node "${nodeName}". It may have been renamed or removed.`;
|
||||
const node = NodeRegistry.getInstance().getNode(nodeId);
|
||||
// Only an explicit local node is neutralized; missing lookup keeps the id fallback.
|
||||
const location = node?.type === 'local'
|
||||
? 'on this node'
|
||||
: `on node "${node?.name ?? String(nodeId)}"`;
|
||||
return `Container "${containerName}" not found ${location}. It may have been renamed or removed.`;
|
||||
}
|
||||
|
||||
/** Hub target tag used for startsWith rethrow guards (no trailing detail). */
|
||||
|
||||
Reference in New Issue
Block a user