@davoodmehraban89 / Factor-easy-2 Mirror · read-only / commits / e073d37
Fork 0

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

Mirrored from https://github.com/davoodmehraban89/Factor-easy.git

Synced Dec 3, 18:15 UTC

docs(phase0): record exact-SHA deployed startup optimization and pending owner latency check

davoodmehraban89 committed Oct 12, 2026 at 13:07 UTC e073d37926da7bfdf1712819dc92d49bff2481c0
1 file changed +9
PROJECT_STATE.md
+9
@@ -406,3 +406,12 @@ Owner reports login blocked with generic 'check internet/VPN' network error on l
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.
409 +
410 +
411 +### 2026-10-12 Phase 0 startup waterfall optimization — RELEASED VIA GATED PAGES / OWNER LATENCY OPEN
412 +- Owner observed very slow startup. Investigated real main: **14 ordered extension scripts loaded one-by-one** *before* starting login/session restoration; optional third-party XLSX was parser-blocking, remote font CSS also contributed blocking. Read-only authorized Windows probe (one sample each): homepage HTTP 200 ~**1.616s**, extension ~**0.477s**, optional Excel CDN ~**2.663s**. `js/` contains 55 files ~0.75 MiB. Live Supabase `public.records` `pg_stat_user_tables.n_live_tup` **estimated ~441 rows / ~600 kB**, no per-user lookup; this does **not** prove user session/pullAll fast, which remains separately unmeasured.
413 +- **Fix shipped:** [PR #100](https://github.com/davoodmehraban89/Factor-easy/pull/100) merged to protected `main` exact SHA **`a67c07a717bffc2a8ee90c7e3cc9db55c2d05881`**. Startup `js/bootstrap.js` now downloads all 14 extension scripts concurrently with `script.async=false` (execute in original dependency order), awaits all loaded/failed before running real Auth and exposes only credential-free timing/asset count and `authChecked`. `index.html` moves optional XLSX script to async, font stylesheet to nonblocking media with safe local-JS activation, cache-busts bootstrap; build-pages retains pre-approved **pinned SRI** for cdnjs Excel under strict production CSP. Existing fake-admin Playwright test waits `authChecked` to avoid test-only race. No client user data or financial write modified.
414 +- **Exact final PR-head evidence** `c45807d949c36c32b6e00aaef3e8f47fa9f1e833`: Quality **`38230103321` SUCCESS** (static 55 JS / 52 MJS syntax PASS, Golden accounting and draft/posted PASS, 3 disposable PostgreSQL jobs PASS, **89/89 Chromium Playwright PASS**; synthetic network **170ms/extension** and extension request spread **3ms**; third-party CDN abort still shows login); Security **`38230103301` SUCCESS** including CSP/SRI release safety and CodeQL. First dry run exposed SRI build guard and then a mock-admin timing race; both were fixed and fully rerun. Never waived release security.
415 +- **Exact protected-main SHA gate verified:** Quality **`38230349289` SUCCESS**, Security **`38230349290` SUCCESS**, Release Gate **`38230688599` SUCCESS**, gated Pages deployment **`38230726054` SUCCESS**. Earlier duplicate Release `38230517388` was CANCELLED, duplicate Pages `38230704316` SKIPPED; excluded from successes.
416 +- **Honest external check:** The authorized remote Windows machine `DESKTOP-71SJ63M` was **offline** when post-publish HTTP parity check was attempted; alternate public fetch was inaccessible. Therefore GitHub proves SHA-gated Pages deploy but **direct domain HTTP parity and owner's actual observed latency not independently verified in this last check**. Owner should hard-refresh once at `factoreasy.ir`, record approximate time to see login and time after sign-in; no password/session/network token disclosure. A remaining possible factor is `enterApp()` awaiting `fetchCurrentUser()` and serial tenant `pullAll()` after authentication, not changed without data-consistency tests.
417 +- **Acceptance:** Focused Phase-0 startup/performance **FIX_IMPLEMENTED / CONTROLLED_QA_PASSED / PAGES_DEPLOYED**; **OWNER_REAL_ISP_BENCHMARK_OPEN**. F0-01/02/03/04/07 remain unaccepted; Phase 0 **OPEN**. No Auth/RLS/roles, server schema, Supabase data, financial posting or account credentials changed. Rollback: revert PR #100 and rerun guarded Pages; no data rollback.