Repository navigation
fix(cap): disable draft_admin_integrity — missing HANA cascade corrupted mission drafts (#2909) - #2992
Merged
Conversation
… cascade constraints corrupted drafts (#2909) The CAP 10.2 cds.fiori.draft_admin_integrity flag was enabled for production (#2909) but the required ON DELETE CASCADE .hdbconstraint files were never generated/deployed. With the flag ON and no cascade, every mission draft activate/discard left ORPHANED draft rows (draft row survives, its DraftAdministrativeData parent is gone). FE then 404s on draftEdit (DRAFT_ALREADY_EXISTS + 'Not Found'), and the discard affordance never renders — making missions permanently un-editable in PROD. Changes: - package.json: flip cds.fiori.draft_admin_integrity to false (prod + all profiles) — reverts to the proven pre-10.2 draft-deletion behavior. The runtime CDS_* env override does NOT work on the deployed build (verified), so this must be a code change. - draft-integrity-preflight.js: the DRAFT_TABLES list used non-existent com_sap_developers_ims_*_drafts names. The real tables are ADMINSERVICE_*_DRAFTS, so the preflight reported 26/26 'missing' and validated NOTHING. Rewrote checkDraftCascadeConstraints to DISCOVER the real draft tables from SYS.TABLE_COLUMNS at runtime so the check can never drift. - Updated unit tests for the two-query discovery contract (14 pass). PROD orphan cleanup (57 rows: 1 MISSIONS_DRAFTS root + 32 COMPLETIONPATHITEMS + 11 COMPLETIONPATHS + 7 MISSIONTAGS + 6 MISSIONCATEGORIES) was done directly in HANA; live drafts (11 admin rows) preserved. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This was referenced Nov 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem (PROD down)
CAP 10.2
cds.fiori.draft_admin_integritywas enabled for production in #2909, but the requiredON DELETE CASCADE.hdbconstraintfiles were never generated or deployed (fd -HI hdbconstraint= empty repo-wide). With the flag ON and no cascade:DraftAdministrativeDataparent is gone).DRAFT_ALREADY_EXISTS+Not FoundondraftEdit, and the discard affordance never renders → missions permanently un-editable in PROD.Reported live today (2026-11-02) on mission
1eaf780c-97c4-496d-88e2-b0e3da2d3f8f.Root cause confirmed
package.jsontop-leveltrue, only[development]setfalse).CDS_*env override does NOT work on the deployed build — verified 3 ways (CDS_FIORIJSON, escapedCDS_FIORI_DRAFT__ADMIN__INTEGRITY,CDS_CONFIG); all flip the flag locally, all ignored by the running app. So this must be a code change.draft-integrity-preflight.jswas checking non-existent table names (com_sap_developers_ims_*_drafts); the real tables areADMINSERVICE_*_DRAFTS. The preflight reported "26/26 missing" and validated nothing — it never would have caught this.Changes
package.json—cds.fiori.draft_admin_integrity: false(prod + all profiles). Reverts to the proven pre-10.2 draft-deletion path.srv/lib/draft-integrity-preflight.js— rewrotecheckDraftCascadeConstraintsto discover the real draft tables fromSYS.TABLE_COLUMNSat runtime (can't drift), handle the empty-schema case, and report dynamictotal.test/unit/draft-integrity-preflight.test.js— updated for the two-query discovery contract. 14 pass; 114 draft/mission/rollup unit tests pass overall.PROD remediation already applied (manual, today)
ADMINSERVICE_MISSIONS_DRAFTSroot + 32COMPLETIONPATHITEMS+ 11COMPLETIONPATHS+ 7MISSIONTAGS+ 6MISSIONCATEGORIES. The 11 live draft admin rows were preserved (scan excludes rows with a liveDraftAdministrativeDataparent). Re-scan = 0 orphans.Follow-ups (not in this PR)
CDS_CONFIGetc.) should be unset after release.ADMINSERVICE_*_DRAFTScascade.hdbconstraintfiles and confirming the (now-fixed) preflight reports them present.🤖 Generated with Claude Code