fix(connection): delete the unreachable duplicated label-drain body (t62 F2)

`_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).
This commit is contained in:
engineer committed 2026-10-12 08:22:10 +01:00
1 parent c05e6fa929
commit 0ef72a1fbb
1 file changed
+9 -9
@@ -694,6 +694,15 @@ class ShieldConnectionManager:
Returns the label (possibly "") when the dump RAN, and None when it did Returns the label (possibly "") when the dump RAN, and None when it did
not run or delivered no output at all. 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 poller = self._poller
if poller is None or not self.connected: if poller is None or not self.connected:
@@ -1110,15 +1119,6 @@ class ShieldConnectionManager:
return cached 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: def _drain_app_label_requests(self) -> None:
"""Start at most one label fetch per watchdog cycle.""" """Start at most one label fetch per watchdog cycle."""
if not self._app_label_requests or self._poller is None: if not self._app_label_requests or self._poller is None: