fix(metric): add validation for logFocusSession operation payload

Adds explicit validation for the {day, duration} payload structure used by
logFocusSession action. This prevents the false positive warning about
"unusual structure" while maintaining correct validation for all other
METRIC operations. The specialized payload format is intentional for
append-only focus session logging.
This commit is contained in:
Johannes Millan 2026-01-19 17:08:38 +01:00
parent c4a9a05055
commit 9ebf98ff3c

View file

@ -112,6 +112,12 @@ const validateUpdatePayload = (
return { success: true };
}
// METRIC focus session logging uses a special shape: { day, duration }
// This comes from logFocusSession action (see metric.actions.ts)
if (entityType === 'METRIC' && 'day' in p && 'duration' in p) {
return { success: true };
}
// Update payloads can have various shapes:
// 1. { task: { id, changes } } or { project: { id, changes } }
// 2. { id, changes }