mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-27 07:52:24 +00:00
land: area/playback-qa 25942a156c (playback-qa)
This commit is contained in:
commit
c4aac993d7
4 files changed
+362
-7
No files matched your search
@@ -1,9 +1,10 @@
|
||||
{
|
||||
"id": "playback-qa-2",
|
||||
"area": "playback-qa",
|
||||
"status": "open",
|
||||
"title": "Capture actual-app local core-flow/mobile baseline before UI changes",
|
||||
"blockedOn": null,
|
||||
"addedOn": "2026-10-20",
|
||||
"filedAt": "1bb3a4fc452969f060c09a286b72b8cd7ac4123e"
|
||||
"id": "playback-qa-2",
|
||||
"area": "playback-qa",
|
||||
"status": "blocked",
|
||||
"title": "Capture actual-app local core-flow/mobile baseline before UI changes",
|
||||
"blockedOn": "Await explicit second browser-only grant after storage release; approved genuine mirror/frozen actual built app ready.",
|
||||
"addedOn": "2026-10-20",
|
||||
"filedAt": "1bb3a4fc452969f060c09a286b72b8cd7ac4123e",
|
||||
"notes": "First actual source-app pass blocked360x800(15s harness timeout,CDNBuffer denied+CSS404); no UI/viewports success claim. Dispatch approved preparation/doc-only normal submission15:14:36. Copied real prepared Buffer6.0.3 mirror SHA256507a593508c51d1397a9a5818ad0b8dbf7e3ad810feaa87cabff87ff56cf3984 plus verified genuine tarballs/provenance into own read-only /tmp/bitvid-playback-qa-2-snapshot; own Buffer APIprobes4/4 exit0. Frozen dispatch actual verifieddist811files/16145338B,manifestSHA2569997b48049fd01d7c7627c009373296c9a4203683522d31bc5ee82ff98e8599b;CSS283d0464…;465runtime/buildinputsidentical. No QA build/browser/install/fetch/productchanges; not byte-identicalCDN or independentlyrebundled/metafileverified. Only exactBufferURL localfulfillment proposed next; allothernonlocalblocked;actualapp remainsBLOCKEDpending2ndgrant."
|
||||
}
|
||||
@@ -0,0 +1,216 @@
|
||||
# playback-qa-2: genuine cached asset plan, not a browser pass
|
||||
|
||||
Read-only preparation authorized by dispatch mailbox20261020T151044; no browser/build/download performed.
|
||||
Inspection HEAD: `8d7e60ebf1761cda479d18a011dc382af5704f7b` (QA2 blocker evidence commit).
|
||||
Actual app/mobile outcome remains blocked; no further viewport or core-flow validation claimed.
|
||||
|
||||
## Found exact source packages, no install needed
|
||||
|
||||
`npm cache ls buffer`, `npm cache ls base64-js`, `npm cache ls ieee754` found exact tarballs in
|
||||
`/home/user/.npm/_cacache`. Offline `cacache.get` using existing `/usr/share/nodejs/cacache`
|
||||
read/verified cached content. Recomputed SHA512 matched each cache integrity string AND the corresponding
|
||||
version's `dist.integrity` in the cached registry packument. No registry/CDN request was made.
|
||||
This establishes consistency with local cached registry metadata, not new online verification.
|
||||
Tar package.json confirms names/versions/main/dependencies; genuine source index.js hashes are below.
|
||||
|
||||
| Package | Tarball bytes | Tarball SHA256 | index.js SHA256 |
|
||||
| --- | ---: | --- | --- |
|
||||
|buffer@6.0.3 |23108 |`555b6f49224afcf6b2c5a9aea7cd34a7f443f395b10532bc5580022d57aa51f5` |`c25853fd31addfce188b01061fe85bfe667d5fb6c7a7bbb1c83d0ddfd8627acc` |
|
||||
|base64-js@1.5.1 |4109 |`b1b7a945b52685269083425216d6597e33d97bf21699d656e92fdb3eb5210a85` |`829eadd8a1a441d25be0cb93b00e16a0d0c20fd294db95d8f2ed87e6954b7182` |
|
||||
|ieee754@1.2.1 |2886 |`8ef14b9b397e339db89db97881fb714f49319d8f0eb1275901f45567b28f9dac` |`fe3e2b20c1ebb57c3b390c8f685ad1e04e6f493517fa7e432f4351bb77a1a4d0` |
|
||||
|
||||
Buffer6.0.3 declares base64-js^1.3.1 and ieee754^1.2.1; cached1.5.1/1.2.1 satisfy these ranges.
|
||||
Neither dependency declares further runtime dependencies. Package license files must accompany scratch extraction.
|
||||
No installed top-level Buffer package is required; tarballs provide genuine source without `npm install`.
|
||||
No exact cached jsDelivr `+esm` response was found in the npm-cache inventory; npm source is CommonJS.
|
||||
|
||||
## Proposed zero-network scratch adapter, approval still required
|
||||
|
||||
1. Re-read exact cached tarballs via the cache inspection script below; verify all hashes/integrities before extraction.
|
||||
2. Extract only safe regular files under their package prefixes into a private scratch node_modules tree
|
||||
(`buffer`, `base64-js`, `ieee754`), rejecting absolute/traversal/symlink/hardlink members.
|
||||
3. Create scratch entry `export { Buffer } from './node_modules/buffer/index.js';`.
|
||||
4. Use existing esbuild0.27.3 only to bundle that real entry/source/dependency graph as browser ESM.
|
||||
Example command, **not run during preparation**:
|
||||
|
||||
```sh
|
||||
/home/user/Documents/GitHub/bitvid/node_modules/.bin/esbuild /tmp/bitvid-playback-qa-2-assets/entry.mjs --bundle --platform=browser --format=esm --outfile=/tmp/bitvid-playback-qa-2-assets/buffer-6.0.3.mjs
|
||||
```
|
||||
|
||||
5. Record output SHA256 and esbuild metafile; require exactly the pinned three genuine package inputs.
|
||||
Validate Buffer.from/toString/base64/float/read-write round trips against real Node Buffer before browser use.
|
||||
These are adapter sanity checks, not replacements for actual app behavior.
|
||||
6. With a new explicit browser grant, map **only** original import URL
|
||||
`https://cdn.jsdelivr.net/npm/[email protected]/+esm` to those local reconstructed ESM bytes using request fulfillment.
|
||||
Every other non-local HTTP/WebSocket request stays blocked/logged; never call route.continue for the mapped CDN.
|
||||
Product files/import graph/global setup remain unchanged. No fake Buffer/toolkit or no-op module.
|
||||
7. If another hard offline dependency appears, stop/report/release again. No speculative substitution or public fetching.
|
||||
|
||||
Fidelity: exact npm Buffer6.0.3 implementation and pinned genuine dependencies, repackaged by local esbuild;
|
||||
**not byte-identical to jsDelivr's generated ESM, nor CDN availability/loader parity qualification**.
|
||||
Actual app/bootstrap/UI can then be exercised with a documented cached-library transport adapter only if approved.
|
||||
No claim yet that this plan makes the full app boot; the first pass stopped before subsequent dependencies ran.
|
||||
|
||||
## CSS: byte-verified existing output candidate
|
||||
|
||||
Existing dispatch build asset (read-only):
|
||||
`/home/user/Documents/GitHub/bitvid-dispatch/dist/css/tailwind.generated.css`,398371 bytes,
|
||||
SHA256 `283d04642d201edba1e9bd5cbc3ede8d74fbd11b50ff0cd2732d463847d2adf3`.
|
||||
Dispatch HEAD read as `8abbaa77b499cbf054ed55147815fb9403f702c3`.
|
||||
Compared465 input files byte-for-byte against this QA checkout: **0 different inputs**.
|
||||
Compared tailwind config content globs(index/embed/components/views/js/torrent), all source CSS except generated
|
||||
output,postcss config,tailwind config,package.json and package-lock.json. The sorted[path,ownSHA256,dispatchSHA256]
|
||||
JSON manifest SHA256 is `58743f25fc1ff7333c2bbc5b2aa9a60b3b833428b81e772bbbf3fe3e7b1b4177`.
|
||||
`git diff 7f99c045..HEAD -- css tailwind.config.cjs postcss.config.cjs index.html embed.html components views js torrent package.json package-lock.json`
|
||||
was empty; dispatch's prior verified preview build at7f99c045 has identical current relevant inputs.
|
||||
No inference from commit names alone: this check compared actual files on disk.
|
||||
|
||||
Dispatch installed versions read: postcss8.5.6,postcss-cli11.0.1,postcss-import15.1.0,tailwindcss3.4.19,
|
||||
autoprefixer10.4.24; esbuild0.27.3 also available in existing main dependencies.
|
||||
No build was run. After approval, copy only this genuine CSS output into scratch after re-verifying output hash
|
||||
and input equality, then serve the missing `/css/tailwind.generated.css` path from scratch. Do not modify
|
||||
or regenerate another area's output. Alternative: later authorized own local CSS build; not needed if approved copy.
|
||||
This is output reuse, not an independent fresh-build/release qualification.
|
||||
|
||||
## Existing harness and remaining dependencies
|
||||
|
||||
`tests/e2e/helpers/bitvidTestFixture.ts` supplies relay overrides,programmatic test-only login and synthetic event
|
||||
seeding; no dedicated Buffer/CDN offline mapping was found by:
|
||||
`rg -n 'route\(|routeWebSocket|buffer@6|cdn.jsdelivr' tests/e2e/helpers scripts/playwright` (no matches).
|
||||
Do not rewrite helpers/config. `vendor/nostr-tools.bundle.min.js` is already local(110545 bytes),
|
||||
SHA256 `2b063a02d0f449d715fc3bb892364c7a859f7c2e443af15321a2bcbd561c4e02`.
|
||||
`js/nostrToolsBootstrap.js` attempts this local bundle and has public fallback imports; all unmatched fallbacks
|
||||
must remain blocked. No toolkit mutation or claim that later dynamic dependency loading was verified.
|
||||
|
||||
## Integrity records
|
||||
|
||||
```json
|
||||
[
|
||||
{
|
||||
"name": "buffer",
|
||||
"version": "6.0.3",
|
||||
"key": "make-fetch-happen:request-cache:https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz",
|
||||
"bytes": 23108,
|
||||
"cacheIntegrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==",
|
||||
"sha256": "555b6f49224afcf6b2c5a9aea7cd34a7f443f395b10532bc5580022d57aa51f5",
|
||||
"registryIntegrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==",
|
||||
"registryMatch": true,
|
||||
"file": "/tmp/bitvid-playback-qa-2-assets/buffer-6.0.3.tgz",
|
||||
"package": {
|
||||
"name": "buffer",
|
||||
"version": "6.0.3",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"base64-js": "^1.3.1",
|
||||
"ieee754": "^1.2.1"
|
||||
},
|
||||
"license": "MIT"
|
||||
},
|
||||
"indexSha256": "c25853fd31addfce188b01061fe85bfe667d5fb6c7a7bbb1c83d0ddfd8627acc"
|
||||
},
|
||||
{
|
||||
"name": "base64-js",
|
||||
"version": "1.5.1",
|
||||
"key": "make-fetch-happen:request-cache:https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz",
|
||||
"bytes": 4109,
|
||||
"cacheIntegrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==",
|
||||
"sha256": "b1b7a945b52685269083425216d6597e33d97bf21699d656e92fdb3eb5210a85",
|
||||
"registryIntegrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==",
|
||||
"registryMatch": true,
|
||||
"file": "/tmp/bitvid-playback-qa-2-assets/base64-js-1.5.1.tgz",
|
||||
"package": {
|
||||
"name": "base64-js",
|
||||
"version": "1.5.1",
|
||||
"main": "index.js",
|
||||
"dependencies": null,
|
||||
"license": "MIT"
|
||||
},
|
||||
"indexSha256": "829eadd8a1a441d25be0cb93b00e16a0d0c20fd294db95d8f2ed87e6954b7182"
|
||||
},
|
||||
{
|
||||
"name": "ieee754",
|
||||
"version": "1.2.1",
|
||||
"key": "make-fetch-happen:request-cache:https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz",
|
||||
"bytes": 2886,
|
||||
"cacheIntegrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==",
|
||||
"sha256": "8ef14b9b397e339db89db97881fb714f49319d8f0eb1275901f45567b28f9dac",
|
||||
"registryIntegrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==",
|
||||
"registryMatch": true,
|
||||
"file": "/tmp/bitvid-playback-qa-2-assets/ieee754-1.2.1.tgz",
|
||||
"package": {
|
||||
"name": "ieee754",
|
||||
"version": "1.2.1",
|
||||
"main": "index.js",
|
||||
"dependencies": null,
|
||||
"license": "BSD-3-Clause"
|
||||
},
|
||||
"indexSha256": "fe3e2b20c1ebb57c3b390c8f685ad1e04e6f493517fa7e432f4351bb77a1a4d0"
|
||||
}
|
||||
]
|
||||
```
|
||||
|
||||
## Offline cache-inspection script
|
||||
|
||||
Requires only existing system cacache; writes tarball copies/report to own scratch, no extraction/install/build.
|
||||
|
||||
```js
|
||||
const cache = require('/usr/share/nodejs/cacache');
|
||||
const fs=require('node:fs/promises');
|
||||
const crypto=require('node:crypto');
|
||||
(async()=>{
|
||||
const results=[];
|
||||
for(const [name,version] of [['buffer','6.0.3'],['base64-js','1.5.1'],['ieee754','1.2.1']]){
|
||||
const key=`make-fetch-happen:request-cache:https://registry.npmjs.org/${name}/-/${name}-${version}.tgz`;
|
||||
const r=await cache.get('/home/user/.npm/_cacache',key);
|
||||
const actual='sha512-'+crypto.createHash('sha512').update(r.data).digest('base64');
|
||||
if(r.integrity!==actual)throw Error('cache integrity mismatch '+name);
|
||||
const file=`/tmp/bitvid-playback-qa-2-assets/${name}-${version}.tgz`;await fs.writeFile(file,r.data);
|
||||
let registryIntegrity=null;
|
||||
try{const p=await cache.get('/home/user/.npm/_cacache',`make-fetch-happen:request-cache:https://registry.npmjs.org/${name}`);registryIntegrity=JSON.parse(p.data).versions?.[version]?.dist?.integrity||null;}catch{}
|
||||
results.push({name,version,key,bytes:r.data.length,cacheIntegrity:r.integrity,sha256:crypto.createHash('sha256').update(r.data).digest('hex'),registryIntegrity,registryMatch:registryIntegrity===actual,file});
|
||||
}
|
||||
await fs.writeFile('/tmp/bitvid-playback-qa-2-assets/cache.json',JSON.stringify(results,null,2));console.log(JSON.stringify(results,null,2));
|
||||
})().catch(e=>{console.error(e);process.exitCode=1;});
|
||||
|
||||
```
|
||||
|
||||
Current action: retain evidence/plan, no browser/full/build while storage holds the slot. Request dispatch review
|
||||
of exact local fulfillment+verified CSS reuse, then a new bounded browser grant before executing any adapter/build.
|
||||
|
||||
## Approved prepared mirror and frozen snapshot (latest checkpoint)
|
||||
|
||||
Dispatch15:14:36 mailbox approved preparation/copy of its genuine prepared mirror and verified dist, plus
|
||||
docs-only normal submission. **No second browser grant yet.** This supersedes the earlier request to build
|
||||
our own adapter: no esbuild/build/install was run by QA. Root's prepared bundle/provenance are copied as approved.
|
||||
|
||||
Own snapshot: `/tmp/bitvid-playback-qa-2-snapshot`, files chmod0444 after copy.
|
||||
Dispatch-owned assets were only read; no other worktree/process was changed. No symlink assets were followed.
|
||||
The exact mirror and all3 tarball SHA256 values were independently verified against the earlier cache report.
|
||||
Copied root provenance states esbuild0.27.3,pins buffer6.0.3/base64-js1.5.1/ieee7541.2.1,no network/hooks.
|
||||
QA did not independently reproduce that bundler output or receive an esbuild input metafile; the earlier
|
||||
metafile-based proposal was not executed. Actual copied bytes are bound by the approved SHA256 below.
|
||||
|
||||
Independent local mirror API sanity checks: `node --input-type=module` importing copied real Buffer, exit0,4/4:
|
||||
UTF8 bytes equal native Node Buffer; base64 round-trip; float64 read/write bytes equal native Buffer; subarray
|
||||
shares backing memory. No app/toolkit behavior replacement was used, and these probes do not qualify app boot.
|
||||
|
||||
```json
|
||||
{
|
||||
"source": "/home/user/Documents/GitHub/bitvid-dispatch/dist",
|
||||
"files": 811,
|
||||
"totalBytes": 16145338,
|
||||
"manifestSha256": "9997b48049fd01d7c7627c009373296c9a4203683522d31bc5ee82ff98e8599b",
|
||||
"indexSha256": "13b12280ffea5529172d081ba30aab64bb6f7140145fa17af407a09fb60786b4",
|
||||
"bufferPolyfillSha256": "9c6412a7c3a7bda9d19ba420a0fad122b4d0e60a3af68ceb43d8eb98b68e6bff",
|
||||
"cssSha256": "283d04642d201edba1e9bd5cbc3ede8d74fbd11b50ff0cd2732d463847d2adf3",
|
||||
"mirrorSha256": "507a593508c51d1397a9a5818ad0b8dbf7e3ad810feaa87cabff87ff56cf3984"
|
||||
}
|
||||
```
|
||||
|
||||
The full sorted path→SHA256 manifest remains in own scratch `dist-manifest.json`; hashed summary above is durable.
|
||||
Next granted pass serves this frozen **actual built app** instead of incomplete source checkout; existing local
|
||||
relay/harness is retained. Only exact public Buffer import URL is fulfilled from local approved bytes and the
|
||||
mirror hit logged. Every other non-local HTTP/WebSocket stays aborted/logged. No CDN fetch/pass-through,crypto
|
||||
stub,toolkit override,product import rewrite or preview3000 use. Stop/release at the next hard prerequisite.
|
||||
|
||||
QA2 stays BLOCKED pending resource grant/actual app result; all unrun viewport/UI checks remain unverified.
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 26 KiB |
@@ -0,0 +1,138 @@
|
||||
# playback-qa-2: actual-app offline baseline blocked
|
||||
|
||||
Baseline HEAD: `ac99ae9a6bdbeae555a30f659b0720ae67e777e8`.
|
||||
Assignment `filedAt`: `1bb3a4fc452969f060c09a286b72b8cd7ac4123e`.
|
||||
`git diff 1bb3a4fc..HEAD -- js index.html config scripts/agent/simple-relay.mjs tests/e2e/helpers/bitvidTestFixture.ts`
|
||||
was empty. Relevant actual app/harness behavior is unchanged; no product/CSS/test/helper/config edits.
|
||||
|
||||
## Plan and authority
|
||||
|
||||
- Use actual repository index/app modules with existing simple-relay and documented test harness relay overrides.
|
||||
- One Chromium pass at360×800,390×844,1280×720; stop at the first hard offline boot blocker.
|
||||
- Block/log non-local HTTP and WebSocket attempts, use only synthetic local notes/test identities if needed.
|
||||
- Inspect feed/nav/Profile/Upload/required fields/overflow/focus only after successful actual app boot.
|
||||
- Preserve precise failure evidence; no module substitution, public downloads, build/full suite or product edits.
|
||||
|
||||
Browser-only slot granted in dispatch mailbox20261020T150619, consumed before preparation.
|
||||
START sent to dispatch15:08:13Z **before** browser/server launch; reservation was in `.task`.
|
||||
Actual execution15:08:16.718Z→15:08:32.952Z (16.234s); no browser/gate contention observed during this pass,
|
||||
no resource waiting between START and execution, no claim about unrelated host work.
|
||||
|
||||
## Actual result
|
||||
|
||||
`node /tmp/bitvid-playback-qa-2/baseline.mjs`: process exit0, **scenario blocked**, not a passing app scenario.
|
||||
Chromium154.0.8037.97, fresh context, first viewport360×800. Existing app is served directly from this worktree
|
||||
on127.0.0.1:31847; existing simple-relay runs on private31848/31849 using its unchanged API.
|
||||
Temporary own node_modules symlink reused existing installed dependencies read-only and was removed afterward.
|
||||
Service workers were disabled to keep interception deterministic; no application methods/toolkit were substituted.
|
||||
|
||||
`page.waitForFunction(() => typeof window.__bitvidTest__ === 'object', null, {timeout:15000})`
|
||||
timed out. This is the documented fixture harness-ready bound, not a retry or relaxed assertion.
|
||||
Static import chain `js/index.js:4` → `js/bufferPolyfill.js:1` requires:
|
||||
|
||||
```js
|
||||
import { Buffer } from "https://cdn.jsdelivr.net/npm/[email protected]/+esm";
|
||||
```
|
||||
|
||||
The network guard blocked that request. Static dependency loading cannot complete, so the app's early
|
||||
`installTestHarness()` statement is never reached. Exactly1 blocked non-local HTTP attempt was observed;
|
||||
0 WebSocket attempts reached the non-local guard,0 pageerror events. This is an offline boot/fixture constraint,
|
||||
not a demonstrated mobile-layout product defect. Missing assets are a separate environment limitation:
|
||||
`http://127.0.0.1:31847/css/tailwind.generated.css` returned404; own worktree has no generated CSS/dist,
|
||||
and building is excluded from this pass. Screenshot shows unstyled static shell/search/logo, not a hydrated app.
|
||||
|
||||
[Captured360×800 screenshot](playback-qa-2-boot-blocker.png)
|
||||
|
||||
| Viewport / flow | Outcome |
|
||||
| --- | --- |
|
||||
|360×800 actual app boot / harness |BLOCKED:15s harness timeout |
|
||||
|390×844 /1280×720 |Not run after first hard blocker |
|
||||
| Feed initial hydration/local seeded cards |Unverified; no synthetic events needed/seeded |
|
||||
| Home/Explore/ForYou navigation |Unverified |
|
||||
| Profile/Upload open-close / required fields |Unverified |
|
||||
| Card controls/touch target sizes/overflow/focus |Unverified; unstyled shell cannot qualify layout |
|
||||
|
||||
No real signer,peers,buckets,public media,production data or external publishing was used.
|
||||
No successful non-local page requests were allowed. Actual local page bootstrap was attempted; this is not
|
||||
module-harness success, full app/mobile qualification, or a Firefox/KNOWN_ISSUES hydration-flake diagnosis.
|
||||
|
||||
## Cleanup and routing
|
||||
|
||||
Own browser/context and app/relay servers closed in finally at15:08:32.952Z. Browser slot RELEASE explicitly
|
||||
sent to dispatch15:08:53Z; .task updated. Preview3000 was untouched; no other processes stopped.
|
||||
Blocker sent with exact trigger and evidence; waiting on dispatch to route an offline asset/harness strategy.
|
||||
Do not permit public CDN traffic or substitute Buffer/app/modules and silently call this an actual-app pass.
|
||||
No full/normal queue submission without dispatch's explicit slot for this new item.
|
||||
|
||||
## Observed browser errors
|
||||
|
||||
```text
|
||||
Failed to load resource: the server responded with a status of 404 (Not Found)
|
||||
Failed to load resource: net::ERR_BLOCKED_BY_CLIENT.Inspector
|
||||
```
|
||||
|
||||
## Reproduction script
|
||||
|
||||
Create `/tmp/bitvid-playback-qa-2`; temporarily link existing installed node_modules into this worktree if absent,
|
||||
then save/run this script using the granted browser-only slot. It closes its own resources on the first blocker.
|
||||
Remove that own symlink after the process exits. Requires existing main checkout Playwright/dependencies;
|
||||
no installing or downloading assets is part of this reproduction.
|
||||
|
||||
```js
|
||||
import { createServer } from 'node:http';
|
||||
import { readFile } from 'node:fs/promises';
|
||||
import { resolve, extname } from 'node:path';
|
||||
import { chromium } from '/home/user/Documents/GitHub/bitvid/node_modules/playwright/index.mjs';
|
||||
import { startRelay } from '/home/user/Documents/GitHub/bitvid-playback-qa/scripts/agent/simple-relay.mjs';
|
||||
const root='/home/user/Documents/GitHub/bitvid-playback-qa';
|
||||
const out='/tmp/bitvid-playback-qa-2';
|
||||
const {writeFile}=await import('node:fs/promises');
|
||||
const result={started:new Date().toISOString(),viewports:[],blockedHttp:[],blockedWs:[],failedLocal:[],pageErrors:[],consoleErrors:[]};
|
||||
const server=createServer(async(req,res)=>{
|
||||
const url=new URL(req.url,'http://127.0.0.1:31847');
|
||||
let path=decodeURIComponent(url.pathname);if(path==='/')path='/index.html';
|
||||
const file=resolve(root,'.'+path);
|
||||
if(!file.startsWith(root+'/')||path.includes('/.')||!['.html','.js','.mjs','.json','.css','.svg','.png','.jpg','.jpeg','.webp','.ico','.woff','.woff2','.ttf','.wasm','.map','.webmanifest'].includes(extname(file))){res.writeHead(404);res.end();return;}
|
||||
try{const data=await readFile(file);res.setHeader('Content-Type',({'.html':'text/html','.js':'text/javascript','.mjs':'text/javascript','.json':'application/json','.css':'text/css','.svg':'image/svg+xml','.wasm':'application/wasm','.png':'image/png','.webmanifest':'application/manifest+json'})[extname(file)]||'application/octet-stream');res.end(data);}
|
||||
catch{res.writeHead(404);res.end();}
|
||||
});
|
||||
let relay,browser;
|
||||
try{
|
||||
await new Promise((ok,no)=>{server.once('error',no);server.listen(31847,'127.0.0.1',ok);});
|
||||
relay=startRelay(31848,{httpPort:31849});
|
||||
browser=await chromium.launch({headless:true,executablePath:'/usr/bin/google-chrome',args:['--no-sandbox']});
|
||||
result.browserVersion=browser.version();
|
||||
const context=await browser.newContext({viewport:{width:360,height:800},serviceWorkers:'block'});
|
||||
await context.route('**/*',route=>{const u=new URL(route.request().url());if(['127.0.0.1','localhost','[::1]'].includes(u.hostname))return route.continue();result.blockedHttp.push(route.request().url());return route.abort('blockedbyclient');});
|
||||
await context.routeWebSocket('**/*',ws=>{const u=new URL(ws.url());if(['127.0.0.1','localhost','[::1]'].includes(u.hostname))ws.connectToServer();else{result.blockedWs.push(ws.url());ws.close();}});
|
||||
await context.addInitScript(()=>{localStorage.setItem('hasSeenDisclaimer','true');localStorage.setItem('__bitvidTestMode__','1');localStorage.setItem('__bitvidTestRelays__',JSON.stringify(['ws://127.0.0.1:31848']));window.__bitvidTestRelays__=['ws://127.0.0.1:31848'];localStorage.setItem('bitvid_admin_whitelist_mode','false');});
|
||||
const page=await context.newPage();
|
||||
page.on('pageerror',e=>result.pageErrors.push(e.message));
|
||||
page.on('console',m=>{if(m.type()==='error')result.consoleErrors.push(m.text().slice(0,700));});
|
||||
page.on('response',r=>{if(r.status()>=400&&new URL(r.url()).hostname==='127.0.0.1')result.failedLocal.push({url:r.url(),status:r.status()});});
|
||||
for(const viewport of [{width:360,height:800},{width:390,height:844},{width:1280,height:720}]){
|
||||
await page.setViewportSize(viewport);
|
||||
await page.goto('http://127.0.0.1:31847/?__test__=1&__testRelays__=ws%3A%2F%2F127.0.0.1%3A31848',{waitUntil:'domcontentloaded'});
|
||||
const v={viewport,flows:{}};result.viewports.push(v);
|
||||
try{
|
||||
await page.waitForFunction(()=>typeof window.__bitvidTest__==='object',null,{timeout:15000});
|
||||
await page.waitForFunction(async()=>{const m=await import('/js/applicationContext.js');return !!m.getApplication();},null,{timeout:15000});
|
||||
await page.locator('[data-testid="video-list"]').waitFor({state:'visible',timeout:15000});
|
||||
v.flows.boot='passed';
|
||||
}catch(e){v.flows.boot='blocked';v.blocker=e.message.split('\n')[0];v.dom=await page.locator('body').innerText();await page.screenshot({path:root+'/docs/testing/playback-qa-2-boot-blocker.png',fullPage:true});result.firstHardBlocker=true;break;}
|
||||
v.layout=await page.evaluate(()=>({clientWidth:document.documentElement.clientWidth,scrollWidth:document.documentElement.scrollWidth,focus:document.activeElement?.tagName}));
|
||||
// Stop at a new blocker rather than modifying product/fixture behavior.
|
||||
v.flows.remaining='actual app booted; further actions require live harness state inspection';
|
||||
await page.screenshot({path:out+`/${viewport.width}.png`,fullPage:true});
|
||||
}
|
||||
await context.close();
|
||||
} catch(e){result.runError=e.stack;process.exitCode=1;}
|
||||
finally{
|
||||
if(browser)await browser.close();
|
||||
if(relay)await relay.close();
|
||||
await new Promise(ok=>server.close(ok));
|
||||
result.ended=new Date().toISOString();result.resourcesClosed=true;
|
||||
await writeFile(out+'/result.json',JSON.stringify(result,null,2));
|
||||
console.log(JSON.stringify({started:result.started,ended:result.ended,browserVersion:result.browserVersion,viewports:result.viewports.map(v=>({viewport:v.viewport,flows:v.flows,blocker:v.blocker})),blockedHttp:result.blockedHttp,blockedWs:result.blockedWs,failedLocal:result.failedLocal,pageErrors:result.pageErrors,runError:result.runError,resourcesClosed:result.resourcesClosed}));
|
||||
}
|
||||
```
|
||||
Reference in new issue
Block a user