toga-ai 1.0.305 → 1.0.306
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: session
|
|
3
|
+
slug: surface-local-db-replay
|
|
4
|
+
title: Reset local DB from beta, then replay Surface-feature DB changes to LOCAL
|
|
5
|
+
author: apeterson
|
|
6
|
+
repos: [toga25-supply, api2, _underscore, dbchanges2]
|
|
7
|
+
framework: "2.0"
|
|
8
|
+
client: shared
|
|
9
|
+
status: active
|
|
10
|
+
created: 2026-07-09
|
|
11
|
+
updated: 2026-07-09
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# Session: surface-local-db-replay
|
|
15
|
+
**Date:** 2026-07-09
|
|
16
|
+
**Project/Repo:** toga25-supply (2.0)
|
|
17
|
+
**Task:** Reset the local dev database from beta (dev-sandbox), fix the resulting breakage, then manually replay the Surface UI feature's DB changes to LOCAL one SQL step at a time, logging every command.
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## What WORKED
|
|
22
|
+
<!-- Include specific file paths and evidence -->
|
|
23
|
+
- **Local DB refresh from beta.** Per-schema `mysqldump` from `dev.sandbox.database.togahub.com` → local `DROP DATABASE`/`CREATE DATABASE` → re-import. Refreshed `Core`, `Client_Compass`, `Client_CompassCanada`, `Client_Nychh`, `Client_Quad`. Verified: local `Core` = 48 tables matched beta's 48; beta reachability proven via `SELECT @@hostname` = `ip-172-17-3-190`. Local backups taken first to `/tmp/LOCAL_BACKUP_<DB>.sql`.
|
|
24
|
+
- **Non-locking dump flags** for the RELOAD-less sandbox `admin` user: `mysqldump --skip-lock-tables --no-tablespaces --set-gtid-purged=OFF --routines --triggers` (NO `--single-transaction`). Dump completed (`-- Dump completed on …` marker present).
|
|
25
|
+
- **Fixed the whole-API 500** (`_Model_Client_BundleTranslation` not found) by bringing `Model/Client/BundleTranslation.php` into local `_underscore` from feature branch `TRUE-80065` (commit `ef6ebd80`). Login worked afterward. No server restart needed (models autoload per-request).
|
|
26
|
+
- **Fixed CompassCanada 1146** (`advanceshippingnoticeitemunits doesn't exist`) by running `toga25-supply/sync_compasscanada_schema.sql` against `Client_CompassCanada` — but only after selecting the DB in the client UI (see failures). SO record loads now.
|
|
27
|
+
- **Surface Core replay to LOCAL (all done):** `ALTER Core.SurfaceElements ADD iconWeightToken` + set weights on ids 17/18/19/21; `sales-order-listing-actions` BUTTON_BAR seed; slug renames (`sales-order-actions`→`sales-order-record-actions`, `sales-order-row-actions`→`sales-order-listing-row-actions`); `sales-order-record-approvals` gate (Core off + enable Compass/CompassCanada/Quad); `sales-order-record-header` surface.
|
|
28
|
+
- **Per-client data (all done):** F1 client feature tables across all 32 `Client_*`; Gina (user 4273) role fix in Compass; Compass Manager (role 8) hides approval-workflow (surf 8/el 19) + admin-notes (surf 20/el 37); Approvals-filter hides — Compass role 8, CompassCanada role 9, Quad + NYCHH all-users.
|
|
29
|
+
- **Execution log** written to `toga25-supply/db-migrations/DB-CHANGE-LOG.md` (SQL-only, per user preference), one entry per step run.
|
|
30
|
+
|
|
31
|
+
## What did NOT work — DO NOT RETRY THESE
|
|
32
|
+
<!-- Exact failure reasons — do not vague-ify -->
|
|
33
|
+
- `mysqldump --single-transaction …` against beta → `mysqldump: Couldn't execute 'FLUSH TABLES WITH READ LOCK': Access denied for user 'admin'@'%' (using password: YES) (1045)`. The sandbox `admin` lacks RELOAD. `--single-transaction` still issues FTWRL on MySQL 8; adding `--skip-lock-tables` did NOT suppress it. Fix = remove `--single-transaction` entirely.
|
|
34
|
+
- Direct `mysql -h dev.sandbox.database.togahub.com` off-VPN → `ERROR 2003 (HY000): Can't connect … (60)` (timeout). Host is firewalled; requires company VPN.
|
|
35
|
+
- Running `sync_compasscanada_schema.sql` with a standalone `USE Client_CompassCanada;` line executed separately from the `CREATE` block → tables landed in the wrong DB; verify `SELECT` returned 0 rows in `Client_CompassCanada` and the SO record kept 1146-ing (identical error). The `USE` did not carry across separate executions in the client. Fix = select `Client_CompassCanada` as the active DB in the client UI, then run the whole file in one execution.
|
|
36
|
+
- Initial assumption that the "still 500s" CompassCanada error was caching — it was not; the tables genuinely weren't in the DB (0-row verify). Don't assume cache before verifying table existence.
|
|
37
|
+
|
|
38
|
+
## Not tried yet (candidates for next session)
|
|
39
|
+
- **F2 ACL-grant verify** (paused by user). Multi-client read-only check drafted: for Compass/CompassCanada/Quad/NYCHH/Prudential, confirm `AclRecordScripts` has both `surfaces/meta` and `surfaces/meta-group` granted. Expectation: already present (Step 1's Section 2 applied it since Core had `meta-group` from the reset). Full 32-client coverage would need a 32-way UNION or a loop.
|
|
40
|
+
- **In-app UI verification** across Compass, Compass Canada, Quad, NYCHH: status badge, record header, approvals gate visibility, and the role-gated hidden buttons.
|
|
41
|
+
- Cleanup of stray empty tables if `sync_compasscanada_schema.sql` first landed in the wrong DB (identify which DB was selected, drop the 17 empties there).
|
|
42
|
+
- Remove the ~3.4 GB of `/tmp/*_beta.sql` dumps and `/tmp/LOCAL_BACKUP_*.sql` backups once confident.
|
|
43
|
+
|
|
44
|
+
## Current file state
|
|
45
|
+
| File | Status | Notes |
|
|
46
|
+
|------|--------|-------|
|
|
47
|
+
| toga25-supply/db-migrations/DB-CHANGE-LOG.md | created | Full SQL-only execution log of the LOCAL replay (steps 1–8 + L2). |
|
|
48
|
+
| _underscore/Model/Client/BundleTranslation.php | added (from branch TRUE-80065) | Fixes the autoload 500; committed source, brought in via git. |
|
|
49
|
+
| Local MySQL (localhost) | modified | Core + 4 clients reset from beta; Surface changes replayed; CompassCanada drift synced. LOCAL only. |
|
|
50
|
+
| toga25-supply/sync_compasscanada_schema.sql | unchanged | Existing file; run against Client_CompassCanada this session. |
|
|
51
|
+
|
|
52
|
+
## Decisions made
|
|
53
|
+
- **Beta reset target scope = Core + Compass/CompassCanada/NYCHH/Quad only** (not all 32), per user. Rationale: those are the clients in play; other locals left as-is.
|
|
54
|
+
- **Use hardcoded element ids 17/18/19/21 (icon weights) and 8/19, 20/37 (Manager hides)** per user preference, after verifying they matched local Core. Rejected: slug-resolved lookups (user wanted the literal ids); but #7/#8 were converted to `NOT EXISTS`-guarded to be idempotent.
|
|
55
|
+
- **DB-CHANGE-LOG entries are SQL-only, added only after the user confirms a step ran** (two explicit user preferences). Large 16 KB DDL (`sync_compasscanada_schema.sql`) referenced rather than inlined to avoid drift.
|
|
56
|
+
- **CompassCanada drift sync classified LOCAL-ONLY** — do NOT replay to beta/prod (prod already has the 17 tables).
|
|
57
|
+
- **NEVER merge the beta branch into a feature branch** (user rule; distinct from resetting the local DB from beta). Missing code (BundleTranslation.php) pulled from the specific feature branch, not a beta merge.
|
|
58
|
+
|
|
59
|
+
## Blockers
|
|
60
|
+
none
|
|
61
|
+
|
|
62
|
+
## Exact next step
|
|
63
|
+
> Run the paused F2 ACL-grant verify (multi-client `SELECT` over `Client_Compass`/`CompassCanada`/`Quad`/`Nychh`/`Prudential` `AclRecordScripts` joined to `Core.RecordScripts`, checking both `meta` and `meta-group` are granted). If any client is missing `meta-group`, run the guarded grant re-run for that client; otherwise mark F2 done and proceed to in-app UI verification.
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
_Saved by /session-save on 2026-07-09_
|
package/package.json
CHANGED