chore(devices): TEMP unconditional power_telemetry log + all X- headers
CI / test (push) Has been cancelled

Cycle 4+ polls landed cleanly but power_telemetry stayed silent even
after a php opcache bounce, so the question is whether the firmware
is sending X-Prev-* at all or the controller is filtering them out.
Log unconditionally on every poll and include every X-* request
header so the next poll shows definitively what's arriving over
the wire. Tighten back once diagnosed.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-05-15 15:32:04 -04:00
parent 0489028486
commit 7081d2bee7
+13 -11
View File
@@ -90,21 +90,23 @@ class DeviceImageController extends AbstractController
$currentImageId = (int) $request->headers->get('X-Current-Image-Id', '-1');
$device->markSeen();
// TEMP: power-monitor — surface the firmware's previous-cycle
// telemetry (awake duration + panel-init time) so we can see
// whether the PIN_PWR rail cut affects either. Logged on every
// poll; greppable via `device.poll.power_telemetry`. Remove
// alongside the firmware's NVS_KEY_PREV_* writes once validated.
$prevAwakeMs = $request->headers->get('X-Prev-Awake-Ms');
$prevPanelInitMs = $request->headers->get('X-Prev-Panel-Init-Ms');
if ($prevAwakeMs !== null || $prevPanelInitMs !== null) {
// TEMP: power-monitor — log every poll with the firmware-side
// headers we care about, even when they're absent, so we can
// tell whether the firmware is sending them at all vs. the
// controller filtering them out. Greppable via
// `device.poll.power_telemetry`. Remove alongside the firmware's
// NVS_KEY_PREV_* writes once validated.
$this->logger->info('device.poll.power_telemetry', [
'mac' => $mac,
'prev_awake_ms' => $prevAwakeMs,
'prev_panel_init_ms' => $prevPanelInitMs,
'prev_awake_ms' => $request->headers->get('X-Prev-Awake-Ms'),
'prev_panel_init_ms' => $request->headers->get('X-Prev-Panel-Init-Ms'),
'boot_reason' => $request->headers->get('X-Boot-Reason'),
'all_x_headers' => array_filter(
$request->headers->all(),
static fn(string $name): bool => str_starts_with(strtolower($name), 'x-'),
ARRAY_FILTER_USE_KEY,
),
]);
}
// Auto-correct Device.model from the firmware's X-Panel-Id header. New
// Devices are created with the default V1 model (see Device entity), so