Repository navigation
fix(main): validate inventory in append order and sanitize json export-import - #1280
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@greptileai review this at apex |
[High impact] The PR appears safe to merge; no new actionable defect was found.
|
…ables from exports Validate inventory movement chains in durable append order (id ASC with index ASC tie-breaker) across native restores, data-only migrations, and JSON imports, preserving created_at as wall-clock audit metadata. Exclude derived FTS virtual/shadow tables and virtual generated columns (customers.phone_digits) from GET /api/db/export, ignore virtual/FTS tables and generated columns on POST /api/db/import, and rebuild search indexes inside the import transaction. Fixes #1272 Fixes #1273
…rmat changed files
…ort-import, and test isolation
952f6f1 to
590aa07
Compare
|
@greptileai review this at apex |
Fixes #1272
Fixes #1273
Intent
Fix the two persistence and recovery defects from the FloCafe 3.13.1 release-readiness audit at 3657545 (Issues #1272 and #1273):
What Changed
created_attimestamp order to durable append sequence (idASC with input-index fallback) to prevent clock rollbacks and NTP time jumps from failing backup restores and imports.GET /api/db/export) viagetTables()and column reflection to exclude FTS virtual tables, FTS shadow tables, and virtual generated columns likecustomers.phone_digits.POST /api/db/import) to ignore virtual or non-application tables and drop unpersisted generated columns when importing existing snapshots.Risk Assessment
✅ Low: The changes are well-bounded, surgical fixes for inventory append-order sorting and FTS/virtual column export/import exclusion with comprehensive test coverage and no architectural regressions.
Testing
Exercised full-stack browser and API flows against a live FloCafe server, validating durable append ordering for inventory recovery under clock rollbacks, exclusion and stripping of FTS virtual/shadow tables and virtual generated columns on export and import, search index rebuilding, and transactional rollback on invalid payloads, with all 7 scenarios passing.
Evidence: Database Export and Import UI Verification Screenshot
Evidence: Live API Scenarios Execution Log
Execution transcript of live HTTP requests against running FloCafe server verifying backward-clock inventory chains in durable append sequence, schema 114 import with FTS index rebuild, and adversarial rollback and deficit rejection.Evidence: Inventory Precision and Backup/Restore Log
Execution log of backup creation, direct native restore, and schema 114->115 data-only restore under backward clock conditions.Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
✅ **Test** - passed
✅ No issues found.
cd frontend && FLO_VERIFICATION_SCREENSHOT_PATH=~/.no-mistakes/evidence/01M5G2BGJ97YH0ATEDAV489ADX/database-export-import.png npx playwright test --config=playwright.config.ts --project=chromium e2e/database-export-import.spec.tsnode tests/run-electron-node-test.cjs tests/database-tools-api.test.tsnode tests/run-electron-node-test.cjs tests/inventory-legacy-precision-backup.test.tsnode ~/.gemini/antigravity-cli/brain/a10b96b3-3b42-4221-a9e3-584d042761b4/scratch/live-e2e-scenarios.js✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.