From 5f31eb76c787d6e795586e210b9304f95610f2ba Mon Sep 17 00:00:00 2001 From: Fredrik Johansson Date: Sun, 12 Jul 2026 20:30:02 +0200 Subject: [PATCH] overview: show when each vault was last updated, and by whom MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Was silently dropping updatedAt/updatedBy even though the server already returned them — the CLI just never printed them. Also resolves updatedBy to the recipient's label server-side (matching how grants already show a label alongside the recipient id) instead of printing a bare recipient_id. Verified against a live server: overview now prints "demo/production (updated by test-box)" instead of omitting that line entirely. Co-Authored-By: Claude Sonnet 5 --- src/cli/commands/recipient.ts | 4 +++- src/server/adminRoutes.ts | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/cli/commands/recipient.ts b/src/cli/commands/recipient.ts index c2cf30f..45a168d 100644 --- a/src/cli/commands/recipient.ts +++ b/src/cli/commands/recipient.ts @@ -31,7 +31,9 @@ export async function adminOverview(): Promise { console.log('\nvaults:'); if (!data.vaults.length) console.log(' none yet.'); for (const v of data.vaults) { - console.log(` ${v.vaultKey}`); + const updated = v.updatedAt ? new Date(v.updatedAt * 1000).toISOString() : 'unknown'; + const by = v.updatedByLabel ?? v.updatedBy ?? 'unknown'; + console.log(` ${v.vaultKey} (updated ${updated} by ${by})`); for (const g of v.grants) { console.log(` ${g.canWrite ? 'rw' : 'r-'} ${g.recipientId} ${g.label ?? '(unknown recipient)'}`); } diff --git a/src/server/adminRoutes.ts b/src/server/adminRoutes.ts index 28967eb..be1a345 100644 --- a/src/server/adminRoutes.ts +++ b/src/server/adminRoutes.ts @@ -57,6 +57,7 @@ router.get('/overview', (_req, res) => { vaultKey: v.vault_key, updatedAt: v.updated_at, updatedBy: v.updated_by, + updatedByLabel: byId.get(v.updated_by)?.label ?? null, grants: listGrantsForVault(v.vault_key).map(g => ({ recipientId: g.recipient_id, label: byId.get(g.recipient_id)?.label ?? null,