سامانه صدور فاکتور و حسابداری

docs(phase0): record verified startup bottleneck, SRI-preserving fix and 89 Chromium passes

davoodmehraban89 committed Oct 12, 2026 at 12:58 UTC c45807d949c36c32b6e00aaef3e8f47fa9f1e833
1 file changed +7
PROJECT_STATE.md
+7
@@ -399,3 +399,10 @@ Owner reports login blocked with generic 'check internet/VPN' network error on l
399 - **Bounded fix:** preserve exact extension order and Auth timing dependency, use ordered **parallel download** for dynamic extension scripts through `script.async=false` before append, await all settled only after ordered execution, and make optional Excel CDN non-parser-blocking (without breaking export/import or replacing it). Capture read-only site/CDN response timings where available. Add deterministic real Chromium startup network test simulating high-latency extension downloads, proving serial-vs-parallel critical path, exact dependency order, once-only Auth after all scripts and graceful error under blocked CDN. Ensure no actual account/tenant data is read, no altered Auth/RLS/roles, schema/ledger, no test account creation, no unapproved data migration.
400 - **QA and release:** preserve fallback if an extension asset fails, maintain existing Quality/Golden/Playwright and Security gates, merge reviewed PR only with verified checks, confirm protected-main CI and published assets. Capture cold-start comparative behavior with synthetic throttled requests; no claim of owner ISP metric without actual owner-machine browser timings.
401 - **Owner-visible progress:** Phase 0 OPEN. F0-01 affected-ISP sign-in, F0-02 real tenant catalog, F0-03 safe persistence, F0-04 physical print, F0-07 two-user access checks remain unverified; do not mark them passed. Rollback: revert this narrowly scoped PR and gated Pages redeploy, no data rollback.
402 +
403 +
404 +### 2026-10-12 Phase 0 startup speed correction — PR controlled browser QA PASS / PRODUCTION RELEASE PENDING
405 +- Investigated owner-reported cold-start delay from actual protected-main sources and authorized remote read-only Windows HTTP probes: `https://factoreasy.ir/` **HTTP 200 ~1.616s**, representative extension **HTTP 200 ~0.477s**, optional CDN SheetJS **HTTP 200 ~2.663s** (one measurement each; not full user-browser timings). Source `js/bootstrap.js` previously waited for **14 individual network-loaded extension modules serially** *before* calling `initAuthSystem`; `index.html` contained parser-blocking third-party XLSX script and CSS. Assets across `js/` total ~0.75 MiB (55 scripts); network round-trip waterfall is a demonstrated structural issue. Authenticated `pullAll()` still uses sequential pages for full tenant data, and its latency on the owner's ISP is **not measured**.
406 +- Fixed in [PR #100](https://github.com/davoodmehraban89/Factor-easy/pull/100): classic extension scripts now append concurrently with `async=false` set before injection (preserves execution/dependencies), wait `Promise.allSettled` before session check; credential-free `window.FinoraStartupStatus` records only extension count/failure count/load time and `authChecked`. Optional Excel CDN loads `async`; external font CSS loads nonblocking with CSP-compatible local listener and Tahoma fallback. `scripts/build-pages.mjs` continues to replace SheetJS with the pre-existing **pinned SRI** cdnjs equivalent and strict CSP, now carrying `async`; no security gate relaxation. Existing admin fake-user browser test now waits for `authChecked` before its fixture, eliminating race from faster real initialization; no user-auth data accessed.
407 +- New `scripts/phase0-startup-performance.spec.js` has two real Chromium cases: artificial **170ms per extension** latency checks all **14 requested in parallel** and ordered bootstrap still shows login; unavailable third-party Excel/font does not prevent auth screen and Excel guard remains. Exact tested PR head `278bda0836aa650d5cf1d96611e4001097433131`: **Quality `38229232737` SUCCESS**, static job **89/89 Playwright Chromium PASS (48.6s)**, extension dispatch spread **5ms** in synthetic slowed network, all 3 disposable DB jobs PASS, Golden accounting and draft/posted safety PASS, 55 JS/52 MJS syntax PASS; **Security `38229232632` SUCCESS**, SRI/CSP release-safety and CodeQL. The earlier initial PR head Security `38228347152` failed on SRI release-builder detection; corrected builder preserved SRI. Initial browser run `38228617932` had exactly one test fixture auth-initialization race (88/89; not published); corrected and rerun fully green.
408 +- **Current classification:** IMPLEMENTED / PR-HEAD_CONTROLLED_QA_PASSED; protected-main merge/Quality/Security/Release/Pages/published-asset verification **PENDING**. F0-01 affected ISP login and owner-specific post-login latency still **UNVERIFIED**, Phase 0 remains OPEN. No Supabase/Auth/RLS/roles/schema, production user, financial ledger, stored records, login permissions or external accounts modified. Rollback PR and gated Pages.