سامانه صدور فاکتور و حسابداری
docs(state): record real-device login CSP release evidence (#108)
davoodmehraban89 committed
Oct 12, 2026 at 21:05 UTC
833b795b7b0320260b91dcbe621bbce04b23f0c3
1 file changed
+9
PROJECT_STATE.md
+9
@@ -54,6 +54,15 @@ The latest user message is the sole source of new instructions. Read AGENTS.md t
54
- **Implementation authority and safety:** change only Pages event-binding ordering and bounded READ-ONLY hydration with visible retry/error; ensure diagnostic handler is loaded before buttons enable; add realistic built Pages Chromium test with artificially stalled unrelated JS and a synthetic restored-session read. Preserve the legacy ERP script execution order and tenant-safe, atomic datastore replacement; no modification to Supabase Auth/RLS/roles/schema, stored financial records or real customer users.
55
- **Acceptance:** demonstrate diagnostic click starts changing UI before intentionally delayed ERP script completes in built CSP artifact; synthetic stuck read must time out and return operable login without prematurely entering app; complete Golden/92+ Chromium/3 DB/Security checks and gated release; actual affected owner ISP acceptance still OPEN. Rollback narrow PR; no DB rollback.
56
57
+### 2026-10-12 P0 owner photo: nonresponsive login diagnostics / session restore — PR #107 RELEASED / OWNER ACCEPTANCE PENDING
58
+- **Owner field evidence:** latest photographed production login displayed `در حال آمادهسازی محیط کار...` without an observed fresh password attempt; the button `بررسی اتصال به سرور ورود` was reported non-responsive. Photo alone does not establish that live GoTrue/Auth or any specific Supabase SQL endpoint failed. Related [issue #106](https://github.com/davoodmehraban89/Factor-easy/issues/106) remains OPEN for actual affected-ISP acceptance.
59
+- **Proven root cause #1 (inert action):** strict-CSP Pages builder replaced `onclick` attributes with handlers registered in `js/generated-event-handlers.js`, but only appended this script after 40+ blocking application JS modules. Core declared `authFormReady` and enabled controls before listeners were bound. [PR #107](https://github.com/davoodmehraban89/Factor-easy/pull/107) moves generated static handlers ahead of core in the built artifact and loads the credential-free connectivity helper before core; only marks controls ready when built handlers exist. Unbuilt legacy ERP script ordering and CSP/SRI enforcement remain intact.
60
+- **Proven root cause #2 (uncancellable hydration wrappers):** `js/organization-rbac.js` overrides both `fetchCurrentUser` (membership/licenses/roles/permissions across multiple queries) and `pullAll` (organization-filtered records), previously discarding the new bounded-read AbortSignal. Fixed by forwarding the same signal to every read-only PostgREST query, retaining strict `organization_id` filter, checking abort/org context before atomic datastore replacement and preserving server RLS as authority; unaffected reads use the existing behavior. Restored-session hydration now has a 25s upper bound, inline error and enabled diagnostics rather than indefinite apparent loading. Versioned cache URLs updated for core/sync/organization module. No financial writes or server Auth policy change.
61
+- **Controlled browser/QA evidence:** final PR head `0911c25cd039785a853b52f0189737c01cdfbe57`: [Quality `38283874464`](https://github.com/davoodmehraban89/Factor-easy/actions/runs/38283874464) SUCCESS, **96/96 Chromium Playwright PASS**, including actual built strict-CSP site click on diagnosis and login validation while a later ERP module was artificially delayed, client session timeout and atomic/cross-tenant aborted-read assertions; Golden accounting, full syntax, three isolated Postgres DB jobs passed. [Security `38283874574`](https://github.com/davoodmehraban89/Factor-easy/actions/runs/38283874574) SUCCESS. Earlier red CI exposed that organization wrappers dropped AbortSignal, a real bug which was fixed rather than weakening the test; a separate dark/light luminance intermittent failure was not treated as success.
62
+- **Exact runtime release:** #107 squash merged to protected `main` as **`23c5f5426bc2f8ad48c6323f1d43b7cf5b556875`**. Exact-SHA Quality [`38284275379`](https://github.com/davoodmehraban89/Factor-easy/actions/runs/38284275379) SUCCESS, Security [`38284275367`](https://github.com/davoodmehraban89/Factor-easy/actions/runs/38284275367) SUCCESS, Release Gate [`38284524466`](https://github.com/davoodmehraban89/Factor-easy/actions/runs/38284524466) SUCCESS, gated Pages deployment [`38284609169`](https://github.com/davoodmehraban89/Factor-easy/actions/runs/38284609169) SUCCESS. Duplicate Release `38284453656` cancelled and Pages `38284586024` skipped, **not** successes.
63
+- **Direct live-domain parity, authorized remote Windows read-only GET:** `https://factoreasy.ir/?loginCspProof=20261012` HTML includes `js/generated-event-handlers.js`, `js/core.js?v=20261012-login-wiring-v3` and `js/sync.js?v=20261012-login-read-cancel-v1`; versioned `js/bootstrap.js` points to `organization-rbac.js?v=20261012-login-scoped-read-v1`, and direct retrieved module contains `finoraOrganizationRead`, `FINORA_LOGIN_READ_TIMEOUT` and scoped read references. No owner credentials, session data, backend mutations, accounts or financial history were accessed.
64
+- **Acceptance boundary / next step:** CODE_RELEASED / SYNTHETIC_E2E_PASSED / LIVE_ASSET_PARITY_VERIFIED; owner actual affected-ISP behavior remains **NOT VERIFIED**, F0-01 and overall Phase 0 remain **OPEN**. Owner should fully refresh `factoreasy.ir`, click `بررسی اتصال به سرور ورود` with no password and report only code (AUTH_OK/AUTH_TIMEOUT/AUTH_UNREACHABLE/SITE_UNREACHABLE), then test permitted existing account login privately. Distinguish slow restored-session permissions/records from Auth service network. Rollback #107 via guarded Pages, no DB rollback.
65
+
66
## Current change ledger
67
| 2026-10-07 | Owner requested accounting/product usability refinement from live screenshots: automatic non-user-entered floating-detail codes, contextual in-product guides (especially accounting/chart/dimensions), remove duplicate product internal tax ID and use product code as internal item ID, strengthen in-control product/person search, introduce hierarchical product group/subgroup coding with deterministic 6-digit product codes, and keep sale/purchase commercial-document workspace layout stable while only semantic fields change. | **IMPLEMENTED / LOCAL VERIFICATION PASSED / CI PENDING** | Baseline main = `7e58c75f7d754f378d94ca3f356c1ae580aa7ee3`. Automatic dimension type/value codes, contextual guides, product-code-as-internal-ID, normalized multi-token search, and additive six-digit product coding implemented. Existing historical codes preserved. Commercial sale/purchase workspaces now share a stable `صدور سند تجاری` header/actions layout; duplicate purchase sidebar injection removed; the public selector is the single document-type selector and the legacy internal invoice-kind control is hidden. Local syntax/static/commerce/UX/accounting phases 2–6/Golden checks passed; protected-branch CI remains pending. |
68