@davoodmehraban89 / Factor-easy / commits / 01bd7d3
Fork 0

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

Fix C8 production Supabase client resolution

davoodmehraban89 committed Oct 1, 2026 at 20:17 UTC 01bd7d314e15a41998475e1fd03fae7bc34aa1f9
2 files changed +2 -2
PROJECT_STATE.md
+1 -1
@@ -105,7 +105,7 @@ Authenticated two-real-user production browser E2E with a persistent legitimate
105 - Baseline before C8 code: main `43680ac03434ed1d6f7f18a0177c7be59c87f1d1`; immediately preceding reconciled baseline `f64249a6c84b3c2e12d41eb14ff1c9c92a0c3dbf` had Quality `36843788152` PASS with accounting/Golden checks and real-DOM `16 passed (8.9s)`, Security `36843788218` PASS, Pages `36843787512` PASS.
106 - Live database review confirmed current RBAC helpers, composite records identity, and C1 canonical correspondence statuses `draft / registered / submitted / closed`; persistent production currently contains no correspondence rows. C8 must therefore treat only `registered` and `submitted` as transitionable and `closed` as terminal.
107 - Added the pre-deployment C8 policy editor/catalog module plus behavior-level Playwright and static contract tests. The module is intentionally NOT loaded by `js/bootstrap.js` until the approved database RPCs are deployed and verified, preventing a broken production control surface.
108 -- Quality workflow now includes the C8 static contract and mocked real-DOM policy publication test while preserving all prior accounting/Golden/ELI/C1-C7 gates.
108 +- Quality workflow now includes the C8 static contract and mocked real-DOM policy publication test while preserving all prior accounting/Golden/ELI/C1-C7 gates. Independent runtime review caught that the real app exposes Supabase as lexical `const sb` rather than `window.sb`; the C8 transport resolver was corrected before activation to support both the production lexical client and test injection.
109 - Database migration, SQL behavioral tests, concurrency test, attach/transition/read RPCs and production C8 E2E remain NOT IMPLEMENTED / NOT VERIFIED. Supabase has no development branch. A development branch would cost $0.01344/hour and is an external-cost boundary requiring explicit cost confirmation before creation.
110
111 ## C8 implementation-plan checkpoint — 2026-10-01
js/office-workflow.js
+1 -1
@@ -25,7 +25,7 @@ function canConfigure(){
25 try{if(typeof hasFinoraCapability==='function')return Boolean(hasFinoraCapability('office_automation','configure'))}catch(_){}
26 return false;
27 }
28 -function rpc(){if(!window.sb||typeof window.sb.rpc!=='function')throw new Error('Supabase client unavailable');return window.sb}
28 +function rpc(){if(window.sb&&typeof window.sb.rpc==='function')return window.sb;try{if(typeof sb!=='undefined'&&sb&&typeof sb.rpc==='function')return sb}catch(_){}throw new Error('Supabase client unavailable')}
29 window.officeWorkflowPolicies=async function(){
30 const organizationId=orgId(); if(!organizationId)throw new Error('organization required');
31 const {data,error}=await rpc().rpc('office_workflow_catalog',{p_organization_id:organizationId});