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

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

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

Synced Dec 4, 10:30 UTC

docs: record org-license race fix, synthetic regression and required release gates

davoodmehraban89 committed Oct 14, 2026 at 23:47 UTC 44fac2e901e10f3ab10fdb9f2d48ac7ad268fd87
1 file changed +3
PROJECT_STATE.md
+3
@@ -704,3 +704,6 @@ Owner reports login blocked with generic 'check internet/VPN' network error on l
704 - **Reproduced source ordering concern:** `js/core.js` calls `initAuthSystem()` while HTML is parsing; a saved session triggers `enterApp()`, which currently starts `fetchCurrentUser()` in parallel with `window.FinoraAppAssetsReady`. The original core `fetchCurrentUser` returns placeholder `type=none,status=unavailable`; `js/organization-rbac.js` arrives later through asynchronous ordered extension loading (`js/bootstrap.js`) and **then** wraps `fetchCurrentUser` to load the real org license. If auth lookup starts earlier, the app retains an unavailable placeholder and `updateLicenseDisplay()` treats missing end date as expired. This is a plausible deterministic race; a mocked Chromium interleaving must be added to prove it.
705 - **Authorized minimal fix:** signal when organization-context wrapper is installed; gate profile entitlement fetch on that signal while keeping the login form interactive and all existing bounded aborts; retain parallel wait for remaining app assets; distinguish genuinely expired/cancelled subscription from unavailable/unknown in the read-only badge. No Supabase schema, RLS, Auth, role, entitlement, financial data or migration changes. Synthetic Playwright race/regression tests, Quality/Security/Pages gates and real owner/test-account production acceptance are required separately. Rollback: revert scoped PR and guarded redeploy.
706 - **Status before implementation:** branch `fix/finora-org-license-bootstrap-race-20261014` created from protected `main`; code fix/CI/merge/release all PENDING.
707 +
708 +- **Scoped code/test implemented (CI PENDING):** `js/core.js` now creates `FinoraOrganizationContextReady`, keeps auth controls independent, and waits for organization adapter readiness before starting entitlement/profile fetch; asset loading still runs concurrently and inherits existing abort timeout. `js/organization-rbac.js` signals after its full module/wrapper installation. `updateLicenseDisplay` differentiates unavailable/unknown from truly expired/cancelled without loosening `canWrite()`. `index.html` and `js/bootstrap.js` cache-bust updated core, loader and org adapter for previously cached browser sessions. New synthetic Chromium test in `scripts/phase0-startup-performance.spec.js` delays organization module 1600ms while starting a fake authenticated transition and asserts no premature placeholder fetch, correct lifetime badge, non-expiry for unavailable state and preserved no-write-to-production behavior. No real account credentials or SQL changes.
709 +- **Evidence needed:** exact head static/build/browser + disposable DB and security CI; protected main merge; guarded Pages deploy + owner test-account hard reload should show `وضعیت اشتراک : نامحدود` if same verified organization context. If not, inspect browser account/organization/version rather than changing entitlements.