Fix remote telemetry adoption reports

This commit is contained in:
rcourtman
2026-07-23 20:38:09 +01:00
parent e8bf181a57
commit e1a05104d9
3 changed files with 6 additions and 1 deletions
@@ -978,6 +978,10 @@ new categorical value against its fixed set before storage. The adoption
report may aggregate those latest-per-install signals and use indexed time
filters plus compressed remote transport, but it must not enrich them with
accounts, request IPs, customer records, or event-level browser data.
The compressed remote-report transport must compile the exact generated Python
program in its unit proof. Its JSON-lines delimiter is escaped at the outer
generator boundary so the program sent over SSH contains a valid `b"\n"`
literal rather than an unterminated bytes literal.
That same telemetry trust boundary must remain operator-inspectable in-product:
the shared system settings surface may preview only the exact runtime payload
Pulse would send, and it must allow an operator to rotate the local telemetry
+1 -1
View File
@@ -1203,7 +1203,7 @@ rows_sql = (
output = gzip.GzipFile(fileobj=sys.stdout.buffer, mode="wb", compresslevel=6)
def emit(value):
output.write(json.dumps(value, separators=(",", ":")).encode("utf-8") + b"\n")
output.write(json.dumps(value, separators=(",", ":")).encode("utf-8") + b"\\n")
try:
db_stats = dict(conn.execute(db_stats_sql).fetchone())
@@ -49,6 +49,7 @@ class TelemetryAdoptionReportTest(unittest.TestCase):
remote_script = run_mock.call_args.kwargs["input"].decode("utf-8")
self.assertNotIn("fetchall", remote_script)
self.assertIn("received_at >= datetime('now', ?)", remote_script)
compile(remote_script, "<telemetry-remote-fetch>", "exec")
def test_fetch_rows_remote_rejects_empty_response(self) -> None:
completed = subprocess.CompletedProcess(