chore: remediate pygienium audit findings

Dead code: 77 verified-unused exports, files (BackArrow, MenuBars,
cookies.ts, db/create.ts, schemas/comment.ts, security-headers.ts) and
12 unused dependencies removed
Comments: ~370 RESTATE comments stripped across 53 files; 2 verbose
blocks tightened; dead commented-out config removed
Complexity: bulkUpsert extracted into 11 per-entity helpers (CCN 156->~10);
login formHandler split into 3 submitters (CCN 63->~5); account page render
split into 8 section components (CCN 40); updatePost SQL builder rebuilt;
assert*Owned consolidated behind generic assertOwnedBy
Defensive guards: 4 redundant rethrow/nullish guards removed
This commit is contained in:
2026-08-11 13:36:18 -04:00
parent 33ca9213f2
commit 898c891bd5
76 changed files with 1437 additions and 2600 deletions

View File

@@ -12,7 +12,6 @@ import {
async function testTimeoutError() {
console.log("\n=== Testing Timeout Error ===");
try {
// This should timeout after 1ms
await fetchWithTimeout("https://httpbin.org/delay/10", { timeout: 1 });
console.log("❌ Should have thrown TimeoutError");
} catch (error) {
@@ -29,7 +28,6 @@ async function testTimeoutError() {
async function testNetworkError() {
console.log("\n=== Testing Network Error ===");
try {
// This should fail to connect
await fetchWithTimeout(
"https://invalid-domain-that-does-not-exist-12345.com"
);
@@ -47,7 +45,6 @@ async function testNetworkError() {
async function testAPIError() {
console.log("\n=== Testing API Error ===");
try {
// This should return 404
const response = await fetchWithTimeout("https://httpbin.org/status/404");
await checkResponse(response);
console.log("❌ Should have thrown APIError");