From 0ef72a1fbb2bab6cd685146cd01142847f151b1f Mon Sep 17 00:00:00 2001 From: engineer Date: Mon, 12 Oct 2026 08:22:10 +0100 Subject: [PATCH] fix(connection): delete the unreachable duplicated label-drain body (t62 F2) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `_sweep_labels` ended with `return cached`, and the whole body of `_drain_app_label_requests` — its docstring, the queue check, the fetch task — followed it at the same indent level. Valid Python, never executed, and invisible to every gate: the sweep, ruff and the stub suite all pass over it. This is the second shipped artefact of its kind (an earlier review found a duplicated statement), so the mechanism lands in the drift sweep next; here the dead copy goes. The `; echo __NSH_EXIT:$?` marker in `_dump_label` is documented while it is touched (t62 nit b): it sits after a `head` pipeline, Android's sh has no PIPESTATUS, so `$?` is head's status and never the dump's. Nothing reads its VALUE — the parser strips the line — and the property that matters is that a command which RAN leaves non-blank output, which is what separates "ran, no label" (a cached negative) from "the transport delivered nothing" (a retry). --- custom_components/nvidia_shield/connection.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/custom_components/nvidia_shield/connection.py b/custom_components/nvidia_shield/connection.py index 9bdc1df..5c46702 100644 --- a/custom_components/nvidia_shield/connection.py +++ b/custom_components/nvidia_shield/connection.py @@ -694,6 +694,15 @@ class ShieldConnectionManager: Returns the label (possibly "") when the dump RAN, and None when it did not run or delivered no output at all. + + The exit marker is a liveness tell, not a status code (t62 nit b): it sits + after a ``head`` pipeline, and the Android shell that runs this has no + PIPESTATUS, so ``$?`` is ``head``'s status rather than the dump's. Nothing + reads its VALUE — ``parse_application_label`` strips the marker line — and + the only property tested here is that a command which RAN leaves non-blank + output even when the device prints no label. That non-blankness is what + separates "ran, no label" from "the transport delivered nothing", which + this method turns into a cached negative versus a retry. """ poller = self._poller if poller is None or not self.connected: @@ -1110,15 +1119,6 @@ class ShieldConnectionManager: return cached - """Start at most one label fetch per watchdog cycle.""" - if not self._app_label_requests or self._poller is None: - return - package = min(self._app_label_requests) - self._app_label_requests.discard(package) - self._tasks.append( - self._create_task(self._fetch_app_label(package), f"app_label_{package}") - ) - def _drain_app_label_requests(self) -> None: """Start at most one label fetch per watchdog cycle.""" if not self._app_label_requests or self._poller is None: