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

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

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

Synced Dec 4, 09:15 UTC

docs(finora): transparently log QA SQL replacement delimiter mistake and fix decision

davoodmehraban89 committed Nov 23, 2026 at 22:57 UTC 50bcfc4cc1c9c49c5153a1555f20930883f78e66
1 file changed +5
PROJECT_STATE.md
+5
@@ -451,3 +451,8 @@ Next action: run and inspect Quality on the latest PR212 head. If any browser te
451 - **Executed QA code SHA `add9342596800727965d1514f92028b0dfa7b7d9`**, [WP1 #45247819766](https://github.com/davoodmehraban89/Factor-easy/actions/runs/45247819766) local stack reached the lifecycle SQL with a real loopback DB connection, after replacing the step-local absent `DB_URL`; original Unix-socket connection error no longer occurred. The unchanged SQL fixture **FAILED at line 44** with concrete `WP4_COMPANY_FY_NOT_FOUND`, not an observed lifecycle behavior failure. This is a newly exposed fixture setup error.
452 - Cause verified against source: `supabase/tests/wp4_journal_document_lifecycle.sql` inserts a synthetic `auth.users` row, and the Auth trigger (migration `20261012080000_fix_identity_bootstrap_license_before_membership.sql`) creates profile, organization/license/member but NOT any `companies`, `fiscalYears`, or `accounts` records. The fixture immediately queries for those records without inserting any. It also has a final malformed anonymous SQL block `DO $` / `END $;` rather than dollar-quoted `DO $$` / `END $$;`; this is source evidence only until SQL reaches it.
453 - **Before follow-up implementation**, limit changes to the existing `supabase/tests/wp4_journal_document_lifecycle.sql` *test fixture* on child Draft PR247: seed exactly one local company, unlocked fiscal year, two valid posting accounts for the Auth-trigger-created synthetic owner in the current transaction, and fix only malformed SQL test delimiter. Do not alter SQL migration, business code, grants, RLS, audit/history, Production or main; no blanket permissions. Retain strict real lifecycle assertions. Rerun WP1 on new exact SHA; any new SQL failure should be diagnosed as fixture vs actual lifecycle behavior, not relabeled PASS. Parent PR219 Quality/Security JS syntax and WP2 Auth fixture defects remain separately open. A90/B50/C20/D55/E53/F10 unchanged.
454 +
455 +
456 +### 2026-11-23 — FIN-QA-219-WP4-DELIMITER-CORRECTION / logged before QA fix
457 +- **QA follow-on code SHA `3855eb7b3cabd961c174fd16e86b12a5cbdfce2d`** [WP1 #45248550120](https://github.com/davoodmehraban89/Factor-easy/actions/runs/45248550120) reached live disposable PostgreSQL test SQL, but failed `syntax error at or near "$"` at `wp4_journal_document_lifecycle.sql:33`. GitHub log proves the Auth user and seeded company/FY/accounts setup SQL executed (`DO`), then failed on the first subsequent malformed `DO $`. **This syntax defect was accidentally introduced in the QA fixture edit:** JavaScript `String.replace(string, replacementString)` interprets `$$` in replacement as a single literal `$`. The final originally broken `DO $`/`END $;` also remained broken for that reason. This is a **QA patching mistake**, NOT a product engine error or a runtime lifecycle finding.
458 +- Correction decision: on Draft PR247 fix **only** the two malformed `DO $` openers and one `END $;` closer in the test fixture to `DO $$` / `END $$;` using replacement callbacks rather than JS replacement strings to preserve literal `$$`. Verify all SQL block delimiters in the GitHub blob before rerunning exact-head WP1. Do not touch migration, app JS, policy, Production, main or source code. Previous RED from missing company/fiscal remains resolved at fixture setup only; no lifecycle PASS claim until actual SQL reaches and passes all assertions. Other inherited PR219 Quality/Security and WP2 remain unsolved. Progress A90/B50/C20/D55/E53/F10 unchanged.