From c4298b0a73d4aa1762149a1b9cc1d6584c685705 Mon Sep 17 00:00:00 2001 From: npeter83 Date: Mon, 5 Oct 2026 00:50:36 +0200 Subject: [PATCH] docs(comments): no WebSocket and no CI in the present tense The chat cut removed the only WebSocket and CI went before it, but comments still leaned on both: `?account=` was justified by the socket, job polling by an in-process WS registry, the e2e flows as "proxy-safe (none use the WebSocket)", and pyrightconfig named a CI container the engine contract test never checked. Each now says what holds today (the wallet gate, no push channel, the two contract test halves, the image build's `npm ci`, the gate). --- backend/app/models.py | 4 ++-- backend/pyrightconfig.json | 4 ++-- backend/tests/test_plex_stream.py | 2 +- frontend/e2e/README.md | 2 +- frontend/playwright.config.ts | 4 ++-- frontend/src/components/ui/ItemCount.dom.test.tsx | 2 +- frontend/src/lib/api/downloads.ts | 7 ++++--- frontend/src/lib/api/facade.test.ts | 3 ++- frontend/src/lib/format.test.ts | 2 +- frontend/src/lib/store.ts | 4 ++-- scripts/check-node-modules.mjs | 4 ++-- 11 files changed, 20 insertions(+), 18 deletions(-) diff --git a/backend/app/models.py b/backend/app/models.py index 6fd47d67..608bc46d 100644 --- a/backend/app/models.py +++ b/backend/app/models.py @@ -889,8 +889,8 @@ class DownloadJob(Base, TimestampMixin, UpdatedAtMixin): """A user's request to download one source — the per-user layer over `MediaAsset`. The worker claims `queued` jobs with ``FOR UPDATE SKIP LOCKED`` and writes live - `progress`/`speed_bps`/`eta_s`/`phase` here (the frontend polls via useLiveQuery — the - worker is a separate process and can't reach the in-process WS registry). `profile_snapshot` + `progress`/`speed_bps`/`eta_s`/`phase` here (the frontend polls via useLiveQuery: there is + no server push channel, and the worker is a separate process anyway). `profile_snapshot` freezes the spec at enqueue so later edits/deletion of the profile don't change this job. `display_name` is the user's own name for the file (display + the Content-Disposition on local download); the on-disk asset is never renamed. `asset_id` links to the shared file diff --git a/backend/pyrightconfig.json b/backend/pyrightconfig.json index 03c48361..c0ec0838 100644 --- a/backend/pyrightconfig.json +++ b/backend/pyrightconfig.json @@ -13,8 +13,8 @@ // image installs — so the lane's version IS the pin, with no host-vs-pin check to drift. // // `pythonVersion` is not free-standing: `/.python-version` is the single source of truth and -// `tests/test_python_engine_contract.py` fails this gate if this file, the two Dockerfiles, the CI -// container or ruff's target-version disagree with it. +// `tests/test_python_engine_contract.py` (with its host half, pythonEngine.contract.test.ts) fails +// this gate if this file, the two Dockerfiles or ruff's target-version disagree with it. // // `include` covers `alembic` for the same reason the ruff lane was widened to it: migrations run on // every container start, so one that raises there crash-loops prod, and "it is generated code" is diff --git a/backend/tests/test_plex_stream.py b/backend/tests/test_plex_stream.py index d8d6c2b3..bb0e85c1 100644 --- a/backend/tests/test_plex_stream.py +++ b/backend/tests/test_plex_stream.py @@ -331,7 +331,7 @@ class TestWantHw: @staticmethod def _opencl(monkeypatch, present): - # Pin the OpenCL-runtime probe so the routing doesn't depend on the CI box's /etc/OpenCL. + # Pin the OpenCL-runtime probe so the routing doesn't depend on the test machine's /etc/OpenCL. monkeypatch.setattr(stream, "_opencl_present", lambda: present) def test_no_hw_when_not_transcoding(self, monkeypatch): diff --git a/frontend/e2e/README.md b/frontend/e2e/README.md index 92f756c5..fba13bd3 100644 --- a/frontend/e2e/README.md +++ b/frontend/e2e/README.md @@ -32,7 +32,7 @@ login-free `/watch/` share link). - **`:8080`** (baked SPA) is authoritative and same-origin. After a **frontend change you must `siftlode dev` (rebuild)** for its baked SPA to carry the latest test hooks. - **`:5173`** (Vite dev) serves source live — the fast refactor loop; it proxies `/api` to `:8080`, - so the stack must still be up. All five flows are proxy-safe (none use the WebSocket): + so the stack must still be up. All five flows are proxy-safe: ```sh PW_BASE_URL=http://localhost:5173 siftlode e2e diff --git a/frontend/playwright.config.ts b/frontend/playwright.config.ts index 922b061f..6fe0aa9e 100644 --- a/frontend/playwright.config.ts +++ b/frontend/playwright.config.ts @@ -4,8 +4,8 @@ import { defineConfig, devices } from "@playwright/test"; * E2E characterization (golden-master) net for the Platform refactor. * * Target (PW_BASE_URL): defaults to the baked localdev stack on :8080 (production-faithful, - * same-origin, no HMR/WS gaps). Point it at http://localhost:5173 for the fast Vite loop — all - * five characterization flows are proxy-safe (none use the WebSocket). + * same-origin, no HMR gaps). Point it at http://localhost:5173 for the fast Vite loop — all + * five characterization flows are proxy-safe. * * The stack must already be UP (owned by `siftlode dev`); there is deliberately no `webServer`. * `e2e/global.setup.ts` seeds the dedicated test account and logs in once, sharing the resulting diff --git a/frontend/src/components/ui/ItemCount.dom.test.tsx b/frontend/src/components/ui/ItemCount.dom.test.tsx index 7f2c3dce..87960490 100644 --- a/frontend/src/components/ui/ItemCount.dom.test.tsx +++ b/frontend/src/components/ui/ItemCount.dom.test.tsx @@ -29,7 +29,7 @@ describe("ItemCount", () => { it("pluralises and thousands-separates a normal count", () => { render(); // Separators come from the shared formatNumber — compare against it, not a fixed en-US string, - // so the test asserts ItemCount's formatting path rather than the CI locale. + // so the test asserts ItemCount's formatting path rather than the runner's locale. expect(text()).toBe(`${formatNumber(192045, "en")} items`); }); diff --git a/frontend/src/lib/api/downloads.ts b/frontend/src/lib/api/downloads.ts index ca3ea310..2c05db1d 100644 --- a/frontend/src/lib/api/downloads.ts +++ b/frontend/src/lib/api/downloads.ts @@ -200,7 +200,7 @@ export const downloadsApi = { // The body IS the file, and the two names ride as headers. Not a style choice: a multipart part is // a DECLARED body, which FastAPI reads and spools BEFORE the route's `current_user` dependency // runs — so with the old shape an unauthenticated caller could make the server write the whole - // per-file allowance to temp (P1). Headers are latin-1 on the wire, hence `encodeURIComponent`; + // per-file allowance to temp. Headers are latin-1 on the wire, hence `encodeURIComponent`; // the server percent-decodes both. Content-Type is left to the browser (the File's own type). uploadDownload: ( file: File, @@ -274,8 +274,9 @@ export const downloadsApi = { revokeDownloadLink: (linkId: number): Promise<{ deleted: number }> => req(`/api/downloads/links/${linkId}`, { method: "DELETE" }), // A plain navigation can't send the X-Siftlode-Account header, so pass the active - // account via ?account= (same wallet-gated selection the WebSocket uses) — otherwise the - // download resolves to the session-default account and 404s for a per-tab account's file. + // account via ?account= (the server honours it only for an account in this browser's wallet) — + // otherwise the download resolves to the session-default account and 404s for a per-tab + // account's file. downloadFileUrl: (id: number): string => { const a = getActiveAccount(); return a != null ? `/api/downloads/${id}/file?account=${a}` : `/api/downloads/${id}/file`; diff --git a/frontend/src/lib/api/facade.test.ts b/frontend/src/lib/api/facade.test.ts index 52bc92fb..fb1f219c 100644 --- a/frontend/src/lib/api/facade.test.ts +++ b/frontend/src/lib/api/facade.test.ts @@ -3,7 +3,8 @@ import { describe, it, expect, beforeAll } from "vitest"; // The façade guard: lib/api.ts is a spread-only façade over per-domain slice modules. These tests // mechanise the two invariants that make that structure safe — so a future edit that reintroduces // the interleave (a method dropped into two slices → a silent last-wins spread override) or bloats -// the barrel (a method defined inline instead of in a domain module) fails CI instead of shipping. +// the barrel (a method defined inline instead of in a domain module) fails the gate instead of +// shipping. // // Scope, on purpose: this covers RUNTIME method-key collisions — the only *silent* failure mode, // since tsc does not flag overlapping spread keys. It deliberately does NOT cover exported-TYPE-name diff --git a/frontend/src/lib/format.test.ts b/frontend/src/lib/format.test.ts index f5c4da4f..29abd9d3 100644 --- a/frontend/src/lib/format.test.ts +++ b/frontend/src/lib/format.test.ts @@ -133,7 +133,7 @@ describe("relativeFromMs", () => { // printed "1 234 567" (and a Hungarian UI in an English browser "1,234,567"). The case below asserts // BOTH languages and that the two differ, rather than comparing against the runtime's own default: // the default is whatever locale the machine running the suite has (Hungarian on the dev box, English -// on a CI image), so a one-language assertion passes under the old bug on half the machines. +// in the test image), so a one-language assertion passes under the old bug on half the machines. describe("formatNumber", () => { afterEach(() => { i18nStub.language = "en"; diff --git a/frontend/src/lib/store.ts b/frontend/src/lib/store.ts index 8320fd55..ebf19eb6 100644 --- a/frontend/src/lib/store.ts +++ b/frontend/src/lib/store.ts @@ -1,8 +1,8 @@ import { useSyncExternalStore } from "react"; // A minimal observable value shared across React components AND non-React code (the api -// layer, websocket handlers, etc.). Replaces the hand-rolled `listeners`/`subscribe`/`emit` -// triad that several modules each re-implemented slightly differently. +// layer, the debug recorder, the error dialog, etc.). Replaces the hand-rolled +// `listeners`/`subscribe`/`emit` triad that several modules each re-implemented slightly differently. export interface Store { get(): T; set(next: T | ((prev: T) => T)): void; diff --git a/scripts/check-node-modules.mjs b/scripts/check-node-modules.mjs index f4d0600e..fb3bd154 100644 --- a/scripts/check-node-modules.mjs +++ b/scripts/check-node-modules.mjs @@ -4,8 +4,8 @@ // The local gate's frontend lanes run against the HOST's node_modules, and nothing tied that tree to // the lock: a `git pull` that bumped a dependency, or an `npm install` that was never committed, left // tsc/eslint/vitest judging the code against packages the build image (`npm ci`) does not use — a -// green that proves nothing about what ships, in either direction. CI is immune (it runs `npm ci`); -// this makes the local lanes say so instead of quietly differing. +// green that proves nothing about what ships, in either direction. The image build is immune (it +// runs `npm ci`); this makes the local lanes say so instead of quietly differing. // // Checks every package the lock places under node_modules/: present, at the pinned version. A package // marked `optional` may be absent (a platform binary for another OS). Exit 1 with the list and the